Sigrid UI
Sigrid is the UI system shared by a suite of React apps, ADHD first, in four levels, each made of the ones before it:
- Primitives (
@acaprino/sigrid/primitives). One control or one surface each, with no idea of what it holds: a
button, a field, a check, a menu, a sheet, a hint, an icon, and the parts a screen is laid out with (Column,
Cluster, Text…).
- Components (
@acaprino/sigrid/components). Primitives put together for one need: a field with its label and
its error, a date, a search box, a note, a row that opens, a list of items, a message, a notice.
- Assemblies (
@acaprino/sigrid/assemblies). Components that do a whole function together, with a state of
their own: the command palette, a conversation and its field, a deck decided one card at a time, a tree, the
attachments and their viewer, the look settings. Those that rest on a library an app may not need have entries of
their own (/table, /virtual, /reorder, /rich-text, /graph, /terminal, /code, /chart), so an app loads only what it uses.
- Applications, as examples (
agents/examples, and the showcase). Whole apps made of the three levels above and
nothing else: a to-do app, a mail client, a workspace, a screen that fits. They are there to start from and to
read; no app is part of the package's code.
Under the levels is the ground, the main entry (@acaprino/sigrid): the theme engine, the tokens, the fonts, the
words and the helpers, with nothing that draws. Beside them are the frame of an app (@acaprino/sigrid/layout:
AppShell in two forms, with lines or as a sheet, its regions and the widths where it gives way, Panel, and the
patterns of docs/patterns.md and docs/mobile.md) and the wiring of a Tauri window from the page
(@acaprino/sigrid/tauri; the native skeleton, src-tauri, is the tauri-app-builder plugin's). A level never imports
from one after it (test/layers.test.ts), and in the source each is a folder: src/primitives, src/components,
src/layout, src/assemblies.
All of it is made for coding agents: AGENTS.md, a catalogue written from the source (agents/), whole example apps,
a check (sigrid-check) and a Claude Code plugin.
It knows nothing of any app: no app's name, concepts or product components. The toolkit's source (src/) knows no
window API of a desktop shell (its title bar is plain web, and a shell drives it from outside: see
Toolbar and title bar); what is Tauri's lives apart, in tauri/. An app builds its product
components on top of it, usually in a package of its own that re-exports what the app needs from here.
MIT licence (LICENSE). The third-party code it adapts (all MIT), and the libraries and fonts it rests on with
their licences, are listed in THIRD_PARTY.md.
Use it
It is not on npm. Clone it next to your app, build it, and depend on the folder:
git clone https://github.com/acaprino/sigrid.git
cd sigrid && npm ci && npm run build
// your app's package.json
"dependencies": { "@acaprino/sigrid": "file:../sigrid" }
import '@acaprino/sigrid/theme.css' // in your Tailwind entry, with an @source on the toolkit's src
import { BASE_THEME, applyTheme, applyDensity } from '@acaprino/sigrid'
import { Button } from '@acaprino/sigrid/primitives'
applyTheme(document.documentElement, { theme: BASE_THEME, scheme: 'light' })
applyDensity(document.documentElement, 'normal') // or 'compact', 'large', or your own DensityDef
The @source is how Tailwind finds the classes the toolkit's components use. After the package is updated, restart
the dev server: Tailwind's watch does not scan node_modules again, so the CSS stays the old one and misses the
classes of the new version (a dialog that is not centred, for one).
On a phone, give the page <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
and put AppShell in it as it is: the frame is as tall as what is seen and keeps clear of the notch and the gesture
bar by itself, so no h-dvh, h-screen or 100vh goes around it (docs/mobile.md, «Heights and orientation»).
To depend on a published version instead of a checkout, see Use a release below.
From 5.x to 6. What draws is no longer exported by the main entry: each name is imported from the entry of its
level (/primitives, /components, /layout, /assemblies), and @acaprino/sigrid keeps what does not draw
(themes, density, words, motion, helpers). agents/catalog.json says which entry exports each name; the names and
the props are the same. The source moved with it: src/components/ui/* is now src/primitives, src/components,
src/layout or src/assemblies, for an app that reads a file by its path (./src/*). React 19 is needed (the peer is
^19.0.0): the parts take ref as a prop and use inert, which React 18 does not have.