AI-interface patterns, finished. A collection of interactive AI-interface patterns for design engineers.
Every pattern has a live demo. Demos that stream play scripted replies in the browser, so there is no model, no server and no API key, and every state can be forced on demand.
- A live demo with a state switcher
- Anatomy, states, a keyboard table and behavior notes
- Accessibility: role, name, focus and announcements
- Guidance
- Next.js 16 (App Router, Cache Components) and React 19
- Base UI components, Tailwind CSS 4
- TypeScript 7, Biome (lint), Prettier (format)
- Vitest and React Testing Library; Playwright with axe-core
- Deployed on Vercel
Requires Node 24 (see .nvmrc).
nvm use
pnpm install
pnpm run devOpen http://localhost:3000.
| Script | Description |
|---|---|
pnpm run dev |
Start the dev server |
pnpm run build |
Production build |
pnpm run lint |
Lint with Biome |
pnpm run format |
Format with Prettier |
pnpm run typecheck |
Generate route types and type-check with tsc |
pnpm test |
Unit tests: content rules, the scripted chat, the composer |
pnpm run test:e2e |
Playwright: every page and every demo state through axe, in both themes |
pnpm run test:e2e needs a browser once: pnpm exec playwright install chromium.
app/ Routes: home, /patterns/[slug]
components/patterns/ One live demo per pattern (<id>-demo.tsx)
components/site/ Navigation, search, theme, demo source
components/ui/ Primitive components
content/patterns/ One typed content file per pattern
lib/patterns.ts The Pattern type and the content floor
lib/use-scripted-chat.ts Scripted replies for the demos that stream
tests/, e2e/ Unit and end-to-end tests
- Write
content/patterns/<id>.tsand add it tocontent/patterns/index.ts. - Build
components/patterns/<id>-demo.tsxand register it incomponents/patterns/index.ts. - Run
pnpm testandpnpm run test:e2e. A pattern that misses a section, or a demo state that fails axe, fails the build.
Add a primitive component with pnpm dlx shadcn@latest add <component>.