Build Your Site with Claude and Meta's Astryx Design System
The repo and the steps to connect Astryx to Claude Code, so Claude builds your pages from real components and templates instead of inventing them as it goes.
Back to all free guidesSo in the reel I showed Astryx, Meta's open source design system, which grew inside the company over the last eight years. Here's the repo and the steps. Left on its own, Claude invents every button and menu as it builds your site. Connect Astryx and Claude gets real, documented parts to build from, plus a rule to start every page from a template.
The repo is here: github.com/meta/astryx
What it is
- Meta's own design system. Meta says it became the most-used and largest design system in the company, and it powers over 13,000 apps.
- Free and open source. MIT licence, with over 32,000 stars on GitHub.
- Over 150 components. Buttons, forms, tables and dialogs, plus ready-made templates for whole pages.
- Every component is documented. They all follow the same naming and prop rules, so Claude can predict how an unfamiliar one behaves before it puts it on your page.
- Seven themes. You can change their colours and fonts without touching a component.
- Built for people and AI assistants. Meta designed the API, the docs and the CLI together so a person and an AI assistant build the same way, and the docs have a setup for Claude Code.
Before you start
- Claude Code installed and signed in.
- Node.js, which gives you
npmandnpxfor the commands below. - A React 19 project for building with the components. Astryx is built on React and StyleX, and it needs React 19 or later. Connecting the hosted docs needs nothing installed at all.
Route 1: the CLI (Meta's docs start here)
In Terminal, inside your project folder, install the packages and let Astryx write its instructions for Claude:
npm install @astryxdesign/core @stylexjs/stylex @astryxdesign/theme-neutral @astryxdesign/cli
npx @astryxdesign/cli init --features agentsinit writes what Claude needs from the installed project: the component index, the rules, the CLI reference and guidance for the packages you've got. It saves them to AGENTS.md. If your project has a CLAUDE.md, it writes them there too, because Claude Code skips AGENTS.md when one exists. After that, Claude runs the Astryx commands itself.
Route 2: the hosted docs, nothing to install
Want to try it before you set up a project? This one command connects Claude Code straight to Astryx's own docs:
claude mcp add --transport http astryx https://astryx.atmeta.com/mcpIt's the same server the CLI runs, for the latest published release, with only the commands that read the docs. So Claude can read up on any component or template. To build with the components in your own project, you still need the packages from Route 1.
How Astryx builds a page
Once it's connected, Astryx tells Claude to start every page from a template, never from scratch. This is the order it gives Claude, and you don't type any of it:
- Find the template.
build, with your idea, names the template to start from and the parts it's missing. - Scaffold it.
templatecopies that template into your project. Claude keeps its frame and spacing and swaps in your content. - Read before using.
componentshows a part's props before Claude drops it in. - Check the build. Astryx tells Claude to run
doctorbefore it hands the page back, and not to deliver a build that fails.
It also gives Claude some house rules. No raw <div> tags, because the components handle layout and spacing. Colours and spacing come from the theme's tokens, never hard-coded hex codes or pixel sizes.
One setup step matters. Without these two imports in your app's entry file (main.tsx, for example), the components show up unstyled:
import "@astryxdesign/core/reset.css";
import "@astryxdesign/core/astryx.css";The seven themes
The README lists seven ready-made themes: neutral, butter, chocolate, matcha, stone, gothic and y2k. A theme is a set of CSS overrides, so you change the whole look of Astryx without forking a single component. The getting started steps set up neutral:
npx @astryxdesign/cli theme add neutralnpx @astryxdesign/cli theme list shows the rest. To make one yours, copy any theme into a theme file you own and change its colours, fonts, corners and spacing.
Or hand that job to Claude. Astryx tells it to use its theme editor, which takes pictures of real components after every change, and says a theme change isn't done until Claude has looked at them.
A first prompt to try
Open Claude Code in your project and paste this, then fill in the last three lines:
Build this site with Astryx. Before you write any code, use Astryx to find the template each page below should start from, and tell me which templates and which theme you'd use. Then build each page from its template with Astryx components only, take colours and spacing from the theme's tokens, and run the Astryx doctor check before you hand it back.
Site:
Pages:
Theme:For Site, write one line on what the business does and who it's for. For Pages, list them, like home, pricing, about and contact. For Theme, pick one of the seven, or ask Claude to choose.
Once the first page is up, ask Claude to change the theme's colours and fonts to match your brand. Every page picks up the change, because the colours come from the theme.