Skip to content

pantoken / packages/core/src / collectIcons

函式: collectIcons()

collectIcons(options?): IconLayer

Beta(測試)

收集統一的 InstUI 圖示圖層。自訂字形優先於同名的 Lucide 字形。輸出依名稱排序以確保結果可重現。

參數

options?

CollectIconsOptions = {}

回傳

IconLayer

範例

收集所有字形以及 icon-colour 特殊值

ts
import { collectIcons } from "@pantoken/core";

const { glyphs, colors } = collectIcons();
// glyphs → IconToken[] (Custom + Lucide, name-sorted)
// colors → [["--instui-icon-color-ai", "…"], ["--instui-icon-color-inherit", "currentColor"]]

僅限 Instructure 作者的字形

ts
import { collectIcons } from "@pantoken/core";

const { glyphs } = collectIcons({ includeLucide: false });
// → only the Custom (Instructure-authored) glyphs