Skip to content

pantoken-root / renderers/web-components/src / iconSvg

函式: iconSvg() ​

iconSvg(name, resolve?): string

Alpha(內測)

將圖示名稱解析為內嵌 SVG(未知時為空字串)。純函式 — 元素會渲染它。

參數 ​

name ​

string

圖示名稱(例如 arrow-left)。

resolve? ​

IconResolver = pantokenResolve

解析器(預設為內建的 pantoken 圖示集)。

回傳 ​

string

範例 ​

ts
import { iconSvg } from "@pantoken/web-components";

const svg = iconSvg("arrow-left"); // "<svg …>…</svg>", or "" when unknown