devicon

package module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 28, 2026 License: BSD-3-Clause Imports: 3 Imported by: 0

README

devicon

ci coverage Go Reference License

Programming-language and tool logos from the Devicon icon set (by konpa and contributors, MIT), as embedded SVG documents keyed by file name — for pure-Go UIs that render their own icons.

import "github.com/go-icons/devicon"

svg := devicon.Icon("main.go")  // the Go language logo, as an SVG string
dir := devicon.Folder()         // a neutral folder glyph

Unlike a full file-type theme, Devicon is a set of language/tool logos. Icon(filename) maps a source file's extension to the logo of the language it is written in (.go → Go, .py → Python, .rs → Rust, .tex → LaTeX …), matching by exact base name first (go.mod, package.json), then by extension. Anything with no language logo falls back to a neutral document glyph, and Folder() returns a neutral folder glyph — Devicon ships no generic file or folder icon, so those two glyphs are minimal originals.

It is a data package: it returns SVG strings and draws nothing. A renderer such as go-widgets/toolkit's SVGIcon turns the SVG into a drawn glyph. Every embedded logo is verified to rasterise under the go-gfx/gfx SVG renderer.

Licence

The Go code and the two neutral fallback glyphs are BSD-3-Clause (LICENSE). The embedded Devicon logo artwork is MIT, © 2015 konpa (DEVICON-LICENSE) — redistributed unmodified.

Documentation

Overview

Package devicon serves programming-language and tool logos from the Devicon icon set (by konpa and contributors, MIT — see DEVICON-LICENSE), as SVG documents keyed by file name.

Unlike a full file-type theme, Devicon is a set of colourful language/tool logos: Icon maps a source file's extension to the logo of the language it is written in, falling back to a neutral document glyph for anything with no language logo. Folder returns a neutral folder glyph. The document and folder glyphs are minimal originals (Devicon ships no generic file or folder icon).

It is a data package: a curated subset of the logos is embedded, and the API returns SVG strings. A renderer such as go-widgets/toolkit's SVGIcon turns the returned SVG into a drawn glyph; this package draws nothing itself.

Index

Constants

View Source
const Name = "Devicon"

Name is the human label a picker shows for this pack.

Variables

This section is empty.

Functions

func Folder

func Folder() string

Folder returns a neutral SVG glyph for a directory.

func Icon

func Icon(filename string) string

Icon returns the SVG document for the file named filename (any path — only the base name matters), matching by exact name first, then by source extension, then a neutral document glyph. It never returns "" for a normal name: the default glyph is embedded.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL