Skip to content

Icons

Grundtone ships icons as a separate opt-in package @grundtone/icons. The icon components in each framework are generic — they accept any icon library that follows the IconDefinition contract, not just @grundtone/icons.

Install

bash
npm install @grundtone/icons
bash
pnpm add @grundtone/icons

Click an icon to copy its name.

IconDefinition Contract

Any icon library compatible with Grundtone must provide objects matching this interface:

ts
interface IconDefinition {
  /** SVG inner content (paths, circles, etc.) */
  body: string;
  /** SVG viewBox attribute */
  viewBox: string;
  /** Optional category for grouping */
  category?: string;
}

The @grundtone/icons package exports a typed registry of these definitions. You can also build your own registry or pass icon definitions directly.

Size Presets

All icon components share these size presets:

SizeDimension
xs12px (0.75rem)
sm16px (1rem)
md20px (1.25rem)
lg24px (1.5rem) — default
xl32px (2rem)
2xl40px (2.5rem)

Color Inheritance

Icons use currentColor, so they inherit the parent's text color. Each icon component also accepts a color prop for explicit overrides.

Next Steps