icon

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package icon is the glyph set the components draw with: the regular-weight Phosphor subset this application uses, vendored as path data.

A glyph is a viewBox and a body, and Resolve is the whole interface. The version this is derived from had a provider chain with layer priorities, a registration seam with a restore function, and an XML sanitiser that walked each glyph checking element names and attribute allow-lists against a depth limit — machinery for glyphs arriving from somewhere else. Nothing arrives from somewhere else: every byte below is in this file, reviewed once, and a product that wants another glyph adds it here.

Vector data is vendored from phosphor-icons/core under the MIT licence; see NOTICE. Package derived from github.com/septagon-oss/pk-ui (Apache-2.0).

Index

Constants

View Source
const Fallback = "question"

Fallback is the glyph an unknown name resolves to. A missing icon renders as a question mark rather than as nothing: a hole in a toolbar is a bug somebody notices, and an empty box is one they do not.

View Source
const ViewBox = "0 0 256 256"

ViewBox is the coordinate system every glyph here is drawn in. It is one value because a set with two would need each glyph to carry its own, and a mixed set is how icons end up at different optical sizes.

Variables

This section is empty.

Functions

func Names

func Names() []string

Names is every glyph this set draws, sorted. The gallery renders them all, so a glyph that is added and never used is visible rather than merely present.

Types

type Glyph

type Glyph struct {
	Name string
	Body string
}

Glyph is one icon: its canonical name and the SVG elements inside the <svg> the Icon component draws. The body is trusted markup — it is a constant in this file — and the component writes it raw.

func Resolve

func Resolve(name string) (Glyph, bool)

Resolve is the glyph for a name, and whether the name was known. An alias resolves to what it names; anything else resolves to Fallback.

Jump to

Keyboard shortcuts

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