Type & iconsMarkdown
Iconography
Icons use Lucide at 16px, 20px, or 24px with a constant 2px stroke enforced by absoluteStrokeWidth. Every icon must carry meaning; decorative icons and emoji are left out.
Icon size mapping
| Control size | Control height | Icon size | Stroke | Sample |
|---|---|---|---|---|
| xs | 24px (1.5rem) | 16px (--control-icon-xs) | 2px (absoluteStrokeWidth) | |
| sm | 32px (2rem) | 16px (--control-icon-sm) | 2px (absoluteStrokeWidth) | |
| md | 40px (2.5rem) | 20px (--control-icon-md) | 2px (absoluteStrokeWidth) | |
| lg | 48px (3rem) | 24px (--control-icon-lg) | 2px (absoluteStrokeWidth) |
Pass strokeWidth={2} and absoluteStrokeWidth on every Lucide icon so a 16px icon and a 24px icon render identical 2px strokes.
Usage
Render Lucide icons paired with text labels or an accessible name:
import { Check, Trash2 } from "lucide-react";
<button
type="button"
className="inline-flex h-10 items-center gap-2 rounded-md border border-border bg-secondary px-4 text-secondary-foreground"
>
<Check size={20} strokeWidth={2} absoluteStrokeWidth aria-hidden="true" />
<span>Save changes</span>
</button>
<button
type="button"
aria-label="Delete item"
className="inline-flex size-8 items-center justify-center rounded-sm border border-border bg-card text-foreground"
>
<Trash2 size={16} strokeWidth={2} absoluteStrokeWidth aria-hidden="true" />
</button>.icon-md {
width: var(--control-icon-md);
height: var(--control-icon-md);
}Do and don't
Do: Use Lucide with absoluteStrokeWidth for meaningful actions
Pair icons with visible labels (or aria-label on icon-only controls) and always set strokeWidth={2} and absoluteStrokeWidth.
Don't: Add decorative icons or emoji
Do not place stock icons beside marketing headings for decoration, and never use emoji characters as UI icons.
Accessibility
- Set
aria-hidden="true"on icons paired with visible text so screen readers do not announce duplicate labels. - Provide an explicit
aria-labelon icon-only buttons and keep the button target at least24px × 24px.
Rationale
absoluteStrokeWidth prevents SVG stroke scaling from thinning 16px icons or thickening 24px icons, keeping line weight uniform with 2px focus and selection borders.