-
Notifications
You must be signed in to change notification settings - Fork 0
package shared icons
GitHub Actions edited this page Sep 17, 2026
·
1 revision
Import: import { IconSprite, spriteSvg, Icon } from "@tundralibs/ui/shared/icons"
IconSprite(): HtmlThe 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(inline = …: boolean): stringThe 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(name: IconName, opts = …: { size?: number; className?: string }): Htmltype IconName = typeOperator-
iconNames:typeOperator— Every icon name, for galleries and sprites.
Guides
Reference