UI projects
Patternmode is the starting point for every new UI. It's a live, tested, published catalogue in ~/Sites/patternmode, and it owns the house theme, motion tokens and pattern components. Scaffold documents when to use it; it doesn't carry a copy.
Start a UI repo
This sequence was run end to end in a fresh repo on 24 September 2026 and checked in a browser: the computed font is Inter Variable and a two-sheet Stacksheet opens.
pnpm create next-app@latest . --typescript --tailwind --app --no-src-dir --import-alias "@/*" --use-pnpm
npx shadcn@latest init -d
npx shadcn@latest add https://patternmode.com/r/theme.json -y
pnpm add @patternmode/stacksheet @howells/motionshadcn initwithout-dstops at interactive prompts for the component library and design preset.-dtakes the defaults, which are Base UI and the Nova preset.- The theme item writes
app/globals.css(light and dark tokens, radii, shadows, the 14px body base with Inter'scvfeatures) and adds@fontsource-variable/inter. Remove the Geistnext/font/googlewiring that create-next-app leaves inapp/layout.tsx; the theme's--font-sansalready points at Inter. - Components are npm packages, pinned once in the workspace catalogue. The registry namespace (
"registries": { "@patternmode": "https://patternmode.com/r/{name}.json" }incomponents.json, thennpx shadcn add @patternmode/<name>) vendors a component's source for the rare repo that needs to edit it; a vendored copy no longer receives fixes. - Follow the Patternmode style guide for typography roles. Apply the recipes in app code, so installed components stay upgradeable.
- Add a
@patternmode/*package when the interaction matches one, and take durations, easings and springs from@howells/motionrather than defining them locally.
Pattern components
Use the package when the interface needs the pattern:
@patternmode/stacksheetfor typed stacked sheets, drill-in panels and multi-layer modal flows@patternmode/apertofor thumbnail-to-expanded media transitions and lightboxes@patternmode/deckfor card decks with finite or cyclic advance@patternmode/scrollframefor scroll areas with measured fades and movement controls@patternmode/swatch,halo,channel,brioletteandparquetfor colour display and colour picking@patternmode/thumbnailfor framed images@patternmode/vergefor controls that reveal on hover, focus or touch@patternmode/tagsfor tags and tag inputs@patternmode/statusfor animated status marks@patternmode/systemfor sizing, composition and weighted-distribution utilities
Keep product-specific behaviour in the app around the package. A pattern that recurs across repos belongs in Patternmode, not in a second copy.
Local ownership
Own these in the project:
packages/uifor the repo's shadcn components and shared compositions, once more than one app needs them- brand-specific token values layered over the Patternmode theme
- page-level compositions and domain-specific compound components
- thin wrappers around shared primitives
Avoid:
- copying Patternmode components into app code instead of installing them
- forking a primitive to change spacing or tone; change tokens or wrap it
- inventing a new token vocabulary; Patternmode components read the standard shadcn variables
Baseline UI stack
- Next.js App Router
- React
- Tailwind CSS v4
- Base UI primitives (
@base-ui/react) - the Patternmode theme
motionand@howells/motionlucide-react
Base UI is the house primitive layer. shadcn scaffolds Base UI-backed components by default, and Base UI ships as one package, @base-ui/react. Radix is a supported opt-out via npx shadcn init -b radix; on Radix, use the unified radix-ui package, never the split per-component Radix packages.
For task-by-task library choices, see Library picks by task.
Overlays
Use different primitives for different overlay jobs:
- a simple drawer or mobile bottom sheet: the repo's
vaul-backed drawer - stacked sheets, panel drills or multi-layer modal flows:
@patternmode/stacksheet; don't stretch avauldrawer into a stack - thumbnail-to-expanded media:
@patternmode/aperto
Storybook
Storybook is for complex projects only: a repo whose shared UI package is large enough that its components need reviewing in isolation. materia and openground have one; most repos don't need it. Patternmode's own catalogue site is its visual contract.
Migrate an existing project
- Install the Patternmode theme and replace local token definitions with overrides on top of it.
- Replace local motion constants with
@howells/motion. - Swap local copies of a Patternmode pattern for the package.
- Keep page-level product code local.
Migrate in stages; alignment doesn't require a one-shot visual rewrite.