vscodeicons

package module
v0.1.2 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

vscode-icons

ci coverage Go Reference License

File-type icons from the vscode-icons icon set (by Roberto Huertas and contributors, MIT), as embedded SVG documents keyed by file name — for pure-Go UIs that render their own icons.

import vscodeicons "github.com/go-icons/vscode-icons"

svg := vscodeicons.Icon("paper.tex") // the vscode-icons .tex glyph, as an SVG string
dir := vscodeicons.Folder()          // the folder glyph

Icon(filename) matches by exact base name first (go.mod, LICENSE, .gitignore, package.json, Dockerfile), then by extension, then falls back to a generic document (default_file). 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.

A curated subset of the vscode-icons artwork is embedded (common source, markup, data and image types). Every embedded icon is verified to rasterise under the go-gfx/gfx SVG renderer; icons that rely on SVG features the renderer does not support (e.g. <polygon>, masks, filters, gradients) are omitted. Contributions adding more are welcome.

Licence

The Go code is BSD-3-Clause (LICENSE). The embedded vscode-icons artwork is MIT, © 2016 Roberto Huertas (VSCODE-ICONS-LICENSE) — redistributed unmodified.

Documentation

Overview

Package vscodeicons serves file-type icons from the vscode-icons icon set (by Roberto Huertas and contributors, MIT — see VSCODE-ICONS-LICENSE), as SVG documents keyed by file name.

It is a data package: a curated subset of the icons is embedded, and Icon maps a file name to the best-matching SVG (falling back to a generic document), Folder returns the folder glyph. 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 = "VSCode Icons"

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

Variables

This section is empty.

Functions

func Folder

func Folder() string

Folder returns the SVG document 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 extension, then a generic document. It never returns "" for a normal name: the default icon 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