@kolkrabbi/kol-icons
v0.5.0
Published
KOL icons — <Icon/>, the curated kol-icon-set-v1 + registerIcons (bring-your-own), and the legacy inventory. Vite-only (import.meta.glob).
Maintainers
Readme
@kolkrabbi/kol-icons
The KOL icon loader — <Icon/> plus the 341-icon registry and raw SVG entries.
Vite-only. Uses
import.meta.globto load the SVG set, so it requires a Vite-based build.
Install
npm i @kolkrabbi/kol-icons # react / react-dom are peersUse
import { Icon, ICONS, ALL_ICONS, hasIcon } from '@kolkrabbi/kol-icons'
<Icon name="arrow-right" size={16} />ICONS— registry grouped by category (rack,navigation,actions, …).ALL_ICONS— flat array of every icon name.hasIcon(name)/getCategory(name)— lookup helpers.SVG_ENTRIES— raw SVG strings for building icon galleries.
Bring your own icons
Register an app-local SVG folder so <Icon name> resolves icons that never ship in the package — each repo carries only what it needs, and the shared set stays small.
import { registerIcons } from '@kolkrabbi/kol-icons'
// once, at app boot. Runs in YOUR source: import.meta.glob is compile-time + path-relative.
registerIcons(import.meta.glob('./icons/**/*.svg', { eager: true, query: '?raw', import: 'default' }))<Icon name="my-app-icon" size={16} /> // resolved from your folderRegistered icons are keyed by filename (basename), win over the packaged set (add or override), and resolve synchronously. Author them with currentColor so they theme.
