Skip to content

Resources

Contributing

Run the repo locally, add a component with examples and docs, and the conventions a pull request should follow.

Desyne is a Bun and Turborepo monorepo.

PathWhat it is
packages/uiThe components (src/components/ui), lib/utils.ts, lib/primitive.ts, theme.css, base.css and the registry metadata (src/registry.ts)
apps/docsThis site (Next.js + Fumadocs). Also serves the public registry at /r/*.json
apps/proThe Pro site: blocks, templates, accounts and the private registry
templates/*Pro template sources
registry.jsonGenerated shadcn registry manifest

Run it

Terminal
bun install
bun run dev              # docs on :3000 (and templates)
bun run registry:build   # registry.json → apps/docs/public/r
bun run typecheck
bun run lint             # Biome
bun run format           # Biome, writing fixes

Add a component

Write it

Create packages/ui/src/components/ui/<name>.tsx. Import from @/lib/utils, @/lib/primitive and @/components/ui/*, the same paths it will have in a user's project. Build on a React Aria primitive, style states with data-* variants and use tailwind-variants for variants and sizes.

Register it

Add an entry to components in packages/ui/src/registry.ts with title, description and category. Dependencies are inferred from the imports when the registry builds.

Add examples

Create apps/docs/examples/<name>/demo.tsx plus one file per example. Each file default-exports a component and becomes a Preview/Code block. Recipes (recipe-*.tsx) combine several components into a realistic pattern.

Document it

Add apps/docs/content/docs/components/<name>.mdx and list it in components/meta.json. Use the standard structure: <ComponentLinks>, <ComponentPreview name="<name>/demo" />, <InstallTabs name="<name>" />, Usage, Examples, Accessibility and API Reference (<TypeTable>). The gallery picks it up automatically.

Conventions

  • Tokens: shadcn names only. New tokens need a light and a dark value and a cssVars entry so the CLI can add them.
  • Sizes: controls use the 28 / 32 / 40px scale (sm, md, lg).
  • Colors: components with a color take color and use tones from lib/primitive.ts.
  • Fields: text-like controls use fieldVariants from field.tsx.
  • Accessibility: keyboard and screen reader behaviour must match the React Aria pattern. Test with the keyboard and one screen reader before opening a PR.
  • Reduced motion: continuous animation needs a motion-reduce: fallback.
  • Server safety: only add "use client" when the component needs it.

Generated files

Don't edit these by hand; their scripts overwrite them:

  • registry.json (from scripts/build-registry.ts)
  • apps/docs/examples/__index__.tsx (from apps/docs/scripts/build-examples.ts, run on dev and build)
  • apps/pro/generated/ (from bun run blocks and bun run templates)

Docs pages

Guides live in apps/docs/content/docs/*.mdx and are ordered in meta.json. MDX pages can use Callout, Cards, Tabs, Steps, TypeTable and ComponentPreview. Keep paragraphs short, show code that compiles against the real components, and link to related pages.