Skip to content

pantoken / packages/core/src / collectIcons

Fungsi: collectIcons()

collectIcons(options?): IconLayer

Beta

Kumpulkan lapisan ikon InstUI yang terpadu. Glif kustom diberi prioritas dibandingkan glif Lucide dengan nama yang sama. Output diurutkan berdasarkan nama untuk hasil yang deterministik.

Parameter

options?

CollectIconsOptions = {}

Mengembalikan

IconLayer

Contoh

Kumpulkan setiap glif beserta nilai khusus 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"]]

Batasi hanya pada glif yang ditulis oleh Instructure

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

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