Icons
The one door for the house icon set. Each icon is a function that draws one licensed glyph at one of four sizes, in the current colour, with a 1.5px line. This page is the API; the Icons page shows the set.
Sizes and colour
Four sizes. The last icon is left at its usual size and takes its colour from a class, since an icon draws in the current colour.
TSX
<SearchIcon size="xs" />
<SearchIcon size="sm" />
<SearchIcon size="md" />
<SearchIcon size="lg" />
<SearchIcon className="text-accent" />How an icon is made
Every export is one line that hands drawIcon a licensed glyph, a short data-icon name and the icon's usual size. drawIcon sets the box from ICON_PX, adds the iconVariants classes and the data-icon attribute, and lets the caller's className win.
TSX
export function SearchIcon(props: IconProps) {
return drawIcon(IconMagnifyingGlass, "search", "sm", props);
}The exports
icons.tsx exports 30 icons, one function each, beside ICON_PX, iconVariants and the two types in the Props table. The Icons page lists every icon with its glyph, its usual size and where it is used.
InfoIcon and MailIcon are not exported here. Each has its own file, so a route that needs one glyph does not load the rest: see Info icon and Mail icon.
Code
TSX
import { CloseIcon, SearchIcon } from "@repo/ui/icons";
<SearchIcon />
<CloseIcon size="lg" />
<SearchIcon className="text-accent" />Every icon takes the same two props. Left alone, an icon draws at its usual size.
Variants
| Prop | Value | How it looks |
|---|---|---|
| size | xs | 12px box (size-3). The usual size of 1 icon. |
| size | sm | 16px box (size-4). The usual size of 15 icons. |
| size | md | 20px box (size-5). The usual size of 14 icons. |
| size | lg | 24px box (size-6). No icon takes it by default. |
| line | 1.5px | Every line glyph draws a 1.5px line at every size (icons.css), so the set reads as one weight. The solid glyphs (play, pause, stop) have no stroke. |
| colour | currentColor | Every icon draws in the current colour, so the wrapper sets it. |
| data-icon | the glyph's name | Each icon carries data-icon, such as "search", for tests. icons.css keys the line rule on it. |
| export | function | Each icon is a function declaration, not the result of a call, so the bundler can drop one no client code uses. |
States
| State | How it looks |
|---|---|
| rest | A static, decorative glyph. The control that holds it carries the accessible name. |
| hover | not written |
| focus | not written |
| disabled | not written |
Props
Import from @repo/ui/icons.
| Prop | Type | Default | What it does |
|---|---|---|---|
| size | "xs" | "sm" | "md" | "lg" | default usual | The icon's box. Left out, it takes the glyph's usual size, which the Icons page lists. Never a number. |
| className | string | undefined | Merged after the size classes. | |
| ICON_PX | { xs: 12, sm: 16, md: 20, lg: 24 } | The size scale in pixels. An icon that needs another size adds a step here. | |
| iconVariants | cva function | The size classes, with shrink-0. Exported so a wrapper can match an icon's box. | |
| IconSize | type | The scale's four names. | |
| IconProps | { className?, size? } | What every icon takes. |
Use it well
Pass size xs, sm, md or lg, never a number. An icon that needs another size adds a step to ICON_PX first.
Name the control, not the icon. An icon is aria-hidden, so give its button a label.
To add an icon, add one function to icons.tsx that passes the glyph, a short data-icon name and its usual size to drawIcon. icons.test.ts counts the exports.
A glyph only one page uses gets its own file, so it does not ship on every page: InfoIcon and MailIcon.
The licensed glyphs are installed from the registry at build time. Never copy one into the repository.