Skip to content

pantoken / packages/core/src / collectIcons

ฟังก์ชัน: collectIcons()

collectIcons(options?): IconLayer

เบต้า

รวบรวมเลเยอร์ไอคอน InstUI แบบรวมเดียว คำสัญลักษณ์ (glyphs) ที่กำหนดเองมีลำดับความสำคัญเหนือ Lucide glyphs ที่มีชื่อเดียวกัน ผลลัพธ์ถูกจัดเรียงตามชื่อเพื่อให้ได้ผลที่กำหนดได้

พารามิเตอร์

options?

CollectIconsOptions = {}

คืนค่า

IconLayer

ตัวอย่าง

รวบรวมทุกสัญลักษณ์ (glyph) รวมถึงค่าพิเศษของสีไอคอน

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"]]

จำกัดเฉพาะสัญลักษณ์ (glyph) ที่เขียนโดย Instructure เท่านั้น

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

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