DS0
Getting Started

Framework Guides

DS0 works with every React framework. The CLI auto-detects your stack — zero config required.

Zero-Config Framework Detection

When you run npx ds0 init, the CLI reads your package.json and automatically:

  1. Detects your framework — Next.js, Vite, Remix, Astro, Gatsby, or CRA
  2. Resolves file paths — Places globals.css, cn() utility, and components in the right directories
  3. Configures Tailwind — Adds the DS0 preset to your existing config

You don't configure anything. It just works.

Framework Decision Matrix

FeatureNext.jsViteRemixAstroGatsbyCRANo Framework
React Components✅ (islands)
Web Components
Tokens (CSS vars)
SSR Support
CLI Auto-DetectManual
Recommended ForAppsSPAsFull-stackContentStaticLegacyVanilla

Setup by Framework

Next.js (App Router)

npx ds0 init -y

What the CLI does:

ActionPath
Components directorycomponents/ds0/ or src/components/ds0/
Global CSSapp/globals.css or src/app/globals.css
Utilitylib/utils.ts or src/lib/utils.ts

First component:

npx ds0 add button
// app/page.tsx
import { Button } from '@/components/ds0/button';

export default function Home() {
  return <Button>Get Started</Button>;
}

Pages Router? Same commands. The CLI detects whether you use app/ or pages/ and places files accordingly.

Vite + React

npx ds0 init -y

What the CLI does:

ActionPath
Components directorysrc/components/ds0/
Global CSSsrc/index.css or src/globals.css
Utilitysrc/lib/utils.ts

First component:

npx ds0 add button
// src/App.tsx
import { Button } from './components/ds0/button';

function App() {
  return <Button>Get Started</Button>;
}

Remix

npx ds0 init -y

What the CLI does:

ActionPath
Components directorysrc/components/ds0/
Global CSSsrc/index.css or src/globals.css
Utilitysrc/lib/utils.ts

First component:

npx ds0 add button
// app/routes/_index.tsx
import { Button } from '~/components/ds0/button';

export default function Index() {
  return <Button>Get Started</Button>;
}

Astro (React Islands)

DS0 React components work inside Astro's React islands via client:load or client:visible.

npx ds0 init -y

First component:

npx ds0 add button
---
// src/pages/index.astro
import { Button } from '../components/ds0/button';
---

<html>
  <body>
    <Button client:load>Get Started</Button>
  </body>
</html>

Prefer no JavaScript? Use DS0 tokens only — you get all the CSS custom properties without shipping any JS. See Cherry-Picking.

Gatsby

npx ds0 init -y

First component:

npx ds0 add button
// src/pages/index.tsx
import { Button } from '../components/ds0/button';

export default function IndexPage() {
  return <Button>Get Started</Button>;
}

Create React App

npx ds0 init -y

First component:

npx ds0 add button
// src/App.tsx
import { Button } from './components/ds0/button';

function App() {
  return <Button>Get Started</Button>;
}

Migrating away from CRA? DS0 components are just files in your project. When you migrate to Vite or Next.js, your DS0 components move with you — no changes needed.

No Framework (Web Components)

Don't use React? DS0 ships Web Components that work in any HTML page.

<!-- Load tokens -->
<link rel="stylesheet" href="https://unpkg.com/@ds0/tokens/css/tokens.css" />

<!-- Load web components -->
<script type="module" src="https://unpkg.com/@ds0/web-components/dist/ds0.js"></script>

<!-- Use them -->
<ds0-button variant="primary">Get Started</ds0-button>
<ds0-dialog>
  <ds0-dialog-trigger>Open</ds0-dialog-trigger>
  <ds0-dialog-content>
    <h2>Hello from DS0</h2>
  </ds0-dialog-content>
</ds0-dialog>

No build step. No bundler. No npm. Just HTML.

Which Framework Should I Pick?

If you're starting fresh and unsure:

Your GoalRecommended
Full-stack web app with SSRNext.js
Fast SPA, no server neededVite
Full-stack with nested layoutsRemix
Content-heavy site (docs, blog)Astro
Prototype / learningVite (simplest)
No build tools at allWeb Components (CDN)

DS0 doesn't care. Pick what fits your project — the components are the same everywhere.

On this page