Skip to content

package shared icons

GitHub Actions edited this page Sep 17, 2026 · 1 revision

package/shared-icons

Import: import { IconSprite, spriteSvg, Icon } from "@tundralibs/ui/shared/icons"

Functions

IconSprite

IconSprite(): Html

The whole set as one hidden <svg> of <symbol id="icon-<name>">s, for inlining once per page; any element can then draw an icon with <svg width="16" height="16"><use href="#icon-search"></use></svg> — no template, no script. This is the plain-HTML answer to Icon().

spriteSvg

spriteSvg(inline = : boolean): string

The same sprite as a standalone SVG document — what dist/icons.svg is. Reference it same-origin (<use href="/ui/icons.svg#icon-search">); browsers refuse cross-origin use, so from the CDN inline IconSprite() instead.

Icon

Icon(name: IconName, opts = : { size?: number; className?: string }): Html

Types

IconName

type IconName = typeOperator

Constants

  • iconNames: typeOperator — Every icon name, for galleries and sprites.

Clone this wiki locally