icon

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: May 23, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package icon provides structured SVG icon rendering for Vango apps.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Lucide

func Lucide(name string, opts ...Option) *vango.VNode

Lucide renders a Lucide icon by kebab-case name.

func SVG

func SVG(data Icon, opts ...Option) *vango.VNode

SVG renders structured SVG icon data.

Types

type Icon

type Icon struct {
	Name    string
	ViewBox string
	Nodes   []Node
}

Icon is structured SVG icon data.

func LookupLucide

func LookupLucide(name string) (Icon, bool)

LookupLucide returns structured Lucide icon data by kebab-case icon name.

type Node

type Node struct {
	Tag      string
	Attrs    map[string]string
	Children []Node
}

Node is a structured SVG element in an icon.

type Option

type Option func(*options)

Option configures icon rendering.

func Attr

func Attr(key string, value any) Option

Attr adds or overrides an arbitrary SVG attribute.

func Class

func Class(classes ...string) Option

Class appends CSS classes to the SVG.

func Decorative

func Decorative() Option

Decorative marks the icon as decorative with aria-hidden="true".

func Fill

func Fill(fill string) Option

Fill sets fill.

func Height

func Height(height int) Option

Height sets the SVG height.

func Label

func Label(label string) Option

Label makes the icon accessible with role="img" and aria-label.

func Size

func Size(size int) Option

Size sets both width and height.

func Stroke

func Stroke(stroke string) Option

Stroke sets stroke.

func StrokeWidth

func StrokeWidth(width float64) Option

StrokeWidth sets stroke-width.

func Width

func Width(width int) Option

Width sets the SVG width.

Jump to

Keyboard shortcuts

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