Anwar Bouilouta

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.

A free guide by Anwar Bouilouta 5 min read

Back to all free guides

So 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 npm and npx for 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:

Run this in Terminal, in your project
npm install @astryxdesign/core @stylexjs/stylex @astryxdesign/theme-neutral @astryxdesign/cli
npx @astryxdesign/cli init --features agents

init 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:

Run this in Terminal
claude mcp add --transport http astryx https://astryx.atmeta.com/mcp

It'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:

  1. Find the template. build, with your idea, names the template to start from and the parts it's missing.
  2. Scaffold it. template copies that template into your project. Claude keeps its frame and spacing and swaps in your content.
  3. Read before using. component shows a part's props before Claude drops it in.
  4. Check the build. Astryx tells Claude to run doctor before 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:

Add these to your app's entry file
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:

Run this in Terminal, in your project
npx @astryxdesign/cli theme add neutral

npx @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:

Paste this into Claude Code
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.

Community now open

My AI Growth Room on Skool is free to join, and the Claude editing skill I use for my reels is in there.

Join free

Where to next

Three ways to get it done

Do it yourself

Free

Every guide points you at one AI tool that's worth your time, with the prompt or checklist to set it up yourself.

See all free guides

Done with you

Community now open

Go from watching AI videos to using AI in your own work every week, with live help and a group doing it alongside you.

Join free

Done for you

With ABAI

For owners of B2B businesses with a bottleneck that's costing them clients. We find it, then build the AI growth system that fixes it, in your own tools and on a fixed fee.

Book a strategy call