Introduction
Installation
StableWhat Foundry needs, what it deliberately avoids, and how the token file connects to Tailwind.
Updated in v1.0.0
There is no package to install
Requirements
The component layer needs React 19 and a Tailwind v4 build. Everything else on this list is either optional or build-time only.
- Package
react- Version
- 19.x
- Why
- Required. Server Components and the modern ref API.
- Package
react-dom- Version
- 19.x
- Why
- Required. Overlays use createPortal.
- Package
next- Version
- 16.x
- Why
- Only for the starters and this documentation site. The primitives are plain React.
- Package
lucide-react- Version
- 1.x
- Why
- Icons. Swappable — every icon is imported by name at the point of use.
- Package
tailwindcss- Version
- 4.x
- Why
- Build-time only. Nothing ships to the browser.
| Package | Version | Why |
|---|---|---|
react | 19.x | Required. Server Components and the modern ref API. |
react-dom | 19.x | Required. Overlays use createPortal. |
next | 16.x | Only for the starters and this documentation site. The primitives are plain React. |
lucide-react | 1.x | Icons. Swappable — every icon is imported by name at the point of use. |
tailwindcss | 4.x | Build-time only. Nothing ships to the browser. |
The token file
Copy src/app/globals.css and import it once, at the root of your application. It contains three things:
- The token declarations, organised by scheme, palette and density
- A
@theme inlineblock that exposes every token to Tailwind, sobg-surface,text-ink-mutedandh-controlall work - A small base layer: focus treatment, reduced motion, prose typography
The theme script
Scheme, palette and density are read from localStorage by a blocking script in <head>, so they are applied before first paint. Without it you will see a flash of the wrong theme on every load. The script is in src/lib/theme.ts and is deliberately written as a string, because it has to run before any bundle exists.
What Foundry does not install
- No state management library — component state is local, page state is in the URL
- No styling runtime — Tailwind compiles away entirely
- No animation library — transitions are CSS, and stop under reduced motion
- No charting library — the one chart in the catalogue is inline SVG plus a data table
- No component library underneath — the primitives are the bottom of the stack
Adapting a starter
The starters are route tables plus a renderer, not ten codebases. To adapt one, copy the route definition you want from src/lib/starters/index.ts, the shell from src/components/starter-kit/, and the blocks the routes name. Everything else is already in the component and section catalogues.