supabase/supabase
design-system
A Next.js + Contentlayer site that documents Supabase's shared design system. Hosted at supabase.com/design-system.
Purpose
Living documentation for components, patterns, charts, fragments, and design tokens used across all Supabase apps. The app references components from packages/ui and packages/ui-patterns rather than housing them.
Directory layout
apps/design-system/
├── app/ # Next.js App Router pages
├── components/ # Site chrome and doc surface
├── content/docs/ # MDX docs for each component
├── config/ # Sidebar / TOC config
├── contentlayer.config.js # Contentlayer schema for MDX
├── registry/ # Examples, fragments, charts, full-component examples
├── __registry__/ # Generated registry output (build artifact)
├── scripts/ # build-registry.ts and friends
├── public/ # Tokens and static assets
└── styles/How it works
Components live in packages/ui (basic primitives) and packages/ui-patterns (composed patterns). The design-system app loads them, renders examples from registry/default/example/, and serves the corresponding MDX docs from content/docs/.
Adding or changing a component requires touching multiple places (per apps/design-system/README.md):
- Add the component in
packages/uiorpackages/ui-patterns. - List it in
apps/design-system/config/docs.ts(sidebar). - Add a doc in
apps/design-system/content/docs/. - Register an example in
apps/design-system/registry/examples.ts, with the example component underregistry/default/example/. - Re-run
pnpm --filter design-system build:registry.
The dev:full script (pnpm --filter design-system dev:full) runs the Next.js dev server alongside Contentlayer's content watcher so MDX edits hot-reload.
Local dev
cd apps/design-system
cp .env.local.example .env.local
pnpm i
pnpm dev:full # → http://localhost:3003Or from the repo root: pnpm dev:design-system (Next.js only) plus pnpm --filter=design-system content:dev in another shell for content watching.
Integration points
- Renders components from
packages/uiandpackages/ui-patterns. - Mirrors the convention used by
apps/ui-library(the public registry surface). - Tokens published from
packages/ui/tokens/**/*.jsonare gitignored and produced by token build scripts.
Entry points for modification
- Document a new primitive → add an MDX file in
content/docs/<area>/<component>.mdx, then register the component inconfig/docs.ts. - Add a code example → drop a
.tsxfile inregistry/default/example/, register it inregistry/examples.ts, then runpnpm build:registry. - Update sidebar or section ordering → edit
config/docs.ts.
Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.