Build a public shadcn registry for Formance's design system, hosted at https://design.formance.com. Anyone can install components via:
npx shadcn add https://design.formance.com/r/<component>.json
Components are organized into three tiers:
- Atoms — base UI primitives (Button, Badge, Input, Calendar, etc.). These are shadcn components with Formance brand styling (colors, typography, variants). They live in
registry/default/ui/. - Fragments — composed patterns built from atoms (DateRangePicker, DataTable, FilterSidebar, etc.). These combine multiple atoms into reusable, opinionated patterns used across Formance products.
- Patterns — full page-level layouts and flows (settings page, list/detail, onboarding wizard). These are higher-level compositions of fragments and atoms.
The sidebar navigation should eventually reflect this taxonomy (Atoms → Fragments → Patterns), replacing the current flat "Components" section.
- Public registry — any team (internal or external) can
npx shadcn addFormance components - Living documentation — every component has live previews, multiple examples showing real-world usage from platform-ui, syntax-highlighted source code, and one-line install commands
- Single source of truth — platform-ui consumes components from this registry, not the other way around. The DS is upstream.
- Brand consistency — Formance fonts (Polymath, Figtree, Berkeley Mono), color tokens, and design decisions are baked into the components
When adding or updating components and examples, use these projects as reference:
/Users/brieuccaillot/Developer/Formance/platform-ui
- UI components:
packages/ui/src/components/— production shadcn components with Formance customizations - Demo components:
packages/ui/src/components/demo/— usage examples (date pickers, forms, data tables, etc.) - Date components:
packages/ui/src/components/date/— DateRangePicker, DateWithHour, DateInput - App components:
packages/ui/src/components/app/— real-world usage (filter sidebar, query builder)
When creating DS examples, check platform-ui for real-world usage patterns to ensure coverage.
/Users/brieuccaillot/Developer/Formance/internal-ui
Monorepo consuming components from this design system registry. Uses npx shadcn add with a local registry URL (http://localhost:3333/r/{name}.json).
- UI package:
packages/ui/— shared components, styles, and configuration - Components:
packages/ui/src/components/— includes both DS-sourced and project-specific components - Code components:
packages/ui/src/components/code/— code-themes, code-editor, code-snippet (synced from DS) - Styles:
packages/ui/src/styles/globals.css— must stay aligned with DSapp/globals.cssfor color tokens - Config:
packages/ui/components.json— shadcn config, must use"style": "default"to match DS
When updating DS color tokens or code-themes, also update internal-ui to keep them in sync.
/Users/brieuccaillot/Developer/Tools/supabase/apps/design-system
Local clone of the Supabase design system. Always read files directly from this path — do not use DeepWiki, WebFetch, or browser tools to look up Supabase DS code.
- Registry components:
registry/default/ui/— shadcn components adapted from platform-ui - Demos:
registry/default/demos/— one per component, shown in the Preview section - Examples:
registry/default/examples/— multiple per component, shown in the Examples section - Config:
config/docs.ts— sidebar nav,componentMeta(slug → registry name, description, source file)config/registry-demos.ts—'use client', maps component names toReact.lazy()demos + examplesconfig/registry-examples.ts— server-safe (no'use client'), example metadata for RSC file reading
- Doc pages:
app/docs/[...slug]/page.tsx— RSC, reads source files, renders previews + code blocks
registry-demos.ts is 'use client' (lazy imports). Server components cannot read its values at runtime. That's why registry-examples.ts exists as a server-safe duplicate of example metadata. When adding examples, update both files.
When copying components from platform-ui, adapt imports:
@platform/ui/lib/utils→@/lib/utils@platform/ui/components/X→@/registry/default/ui/X
pnpm dev # localhost:3333