Category Illustrations
A larger sibling to BandIcon / CardKindIcon: an 80×80 line-art illustration set with soft, low-opacity fills layered on the strokes. Pass category="curries" (or any registered category name) and the matching SVG renders inline.
curries
street-food
drinks
sweets
quick-meals
Customize
Illustration set
curries
80px
accent
Installation
npx shadcn@latest add https://craftbits.dev/r/category-illustrations.jsonUsage
import { CategoryIllustration } from "@craft-bits/core";
<CategoryIllustration category="curries" />
<CategoryIllustration category="drinks" size={64} accentColor="var(--cb-accent)" />Iterate the full set when you need a category picker:
import { CATEGORY_NAMES, CategoryIllustration } from "@craft-bits/core";
{CATEGORY_NAMES.map((c) => (
<CategoryIllustration key={c} category={c} />
))}Understanding the component
- Single inline SVG.
CategoryIllustrationrenders one<svg viewBox="0 0 80 80">and dispatches oncategory. No per-illustration imports or bundle bloat from a file per category. accentColorprop,currentColordefault. Every stroke and fill resolves toaccentColor, which defaults tocurrentColor. Tint by settingtext-cb-*on a parent or pass any CSS color string explicitly.- Layered strokes and soft fills. Each illustration mixes 2–2.5px strokes (silhouette) with low-opacity fills (rim, garnish, liquid surface) so it reads as more than a flat outline at hero / category-card sizes.
CATEGORY_ILLUSTRATIONSmap for iteration. A static record baked atcurrentColoris exported for legends and sidebars that iterate the set without re-listing names.
Variants / Examples
// Tint via parent color.
<span className="text-cb-accent">
<CategoryIllustration category="sweets" size={96} />
</span>
// Pass an explicit accent color (e.g. when nesting inside a non-tinted parent).
<CategoryIllustration category="quick-meals" accentColor="oklch(0.7 0.2 50)" />Props
| Prop | Type | Default | Description |
|---|---|---|---|
category | 'curries' | 'street-food' | 'drinks' | 'sweets' | 'quick-meals' | required | Which illustration to render. |
size | number | 80 | Pixel width / height. |
accentColor | string | 'currentColor' | CSS color applied to every stroke and fill inside the illustration. |
className | string | — | Extra classes merged onto the root SVG. |
Accessibility
- Each illustration is decorative (
aria-hidden="true") by default. If the glyph carries meaning on its own, pair it with a visible text label or override witharia-labelandaria-hidden={false}on the consuming element. - Default fill is
noneand strokes useaccentColor(which defaults tocurrentColor), so contrast tracks the parent text color and inherits anyprefers-contrastoverrides applied site-wide. - No motion. Reduced-motion users see the same static illustration.
Credits
- Extracted from:
terminal-dreams(src/components/cookbook/CategoryIllustrations.tsx).