Getting Started
Add the design system to your project and start building.Quick Start with AI
Paste this into your AI coding tool and let it handle the setup:Paste this into your AI
textInstall @xds/core, @xds/theme-default, and @xds/cli in this project. Run `npx astryx init` to set up agent docs. Read the generated files to learn the conventions.
Install
Add the core package, a theme, and the CLI to your existing project.Terminal
Then run the init wizard to set up AI agent docs, pick a starter template, and learn about theming.bashnpm install @xds/core @xds/theme-default @xds/cli
Terminal
bashnpx astryx init
Add the theme CSS
Import the reset stylesheet and a theme in your global CSS file. Themes provide all design tokens (colors, spacing, radius, typography) as CSS custom properties.globals.css
Available themes: @xds/theme-default (blue accent), @xds/theme-neutral (grayscale), @xds/theme-brutalist (zero radius, monospace). See css@import '@xds/core/reset.css';@import '@xds/core/astryx.css';@import '@xds/theme-default/theme.css';
npx astryx docs theme for the full theming guide.Add your first component
Components are imported from per-category subpath entrypoints. This keeps bundles small and makes intent clear.app/page.tsx
tsximport {Button} from '@xds/core/Button';import {VStack} from '@xds/core/Layout';export default function Page() {return (<VStack gap={2}><Button label="Hello XDS" onClick={() => alert('Hi!')} /></VStack>);}
Customize with xstyle
Every component accepts anxstyle prop for StyleX style overrides created via stylex.create().Style overrides
tsximport * as stylex from '@stylexjs/stylex';const overrides = stylex.create({save: { alignSelf: 'flex-end', marginTop: 16 },});<Button label="Save" xstyle={overrides.save} />
Example Apps
For a full working project, clone one of the example apps from the repo. These are complete setups with routing, theming, and components wired together.| Example | Stack | Path |
|---|---|---|
| Next.js | Next.js + theme CSS | apps/example-nextjs |
| Next.js + StyleX | Next.js + StyleX for custom styles | apps/example-nextjs-stylex |
| Next.js + Tailwind | Next.js + Tailwind bridge | apps/example-nextjs-tailwind |
| Next.js Source | Next.js importing from source | apps/example-nextjs-source |
| Vite | Vite | apps/example-vite |
Clone and run an example
bashgit clone https://github.com/facebookexperimental/xds.gitcd xds/apps/example-nextjspnpm installpnpm dev
Explore the CLI
The CLI is your reference for components, tokens, templates, and docs. For reliable invocation (especially with AI assistants), add this script to your package.json:package.json
Then discover what's available:json"scripts": {"xds": "node node_modules/@xds/cli/bin/xds.mjs"}
Terminal
bashnpx astryx component # list all componentsnpx astryx component Button # props, usage, theming for Buttonnpx astryx docs # list all doc topicsnpx astryx template --list # available page templatesnpx astryx docs tokens # spacing, color, radius reference