Skip to content

pantoken-root / packages/core/src / collectIcons

Hàm: collectIcons() ​

collectIcons(options?): IconLayer

Beta

Thu thập lớp biểu tượng InstUI thống nhất. Các glyph tùy chỉnh được ưu tiên hơn các glyph Lucide cùng tên. Đầu ra được sắp xếp theo tên để có kết quả xác định.

Tham số ​

options? ​

CollectIconsOptions = {}

Trả về ​

IconLayer

Các ví dụ ​

Thu thập mọi glyph cùng với các giá trị đặc biệt 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"]]

Chỉ giới hạn ở các glyph do Instructure tạo

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

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