• Give the coding agent a design system. Astryx supplies React components, theme tokens and project guidance the agent can consult while it works.
  • Keep the same interface across themes. In our reading-list demo, the list and Add book form use the same component code as the theme changes.
  • Check what the keyboard does. We tested opening the form, moving within it and returning to the Add book button after closing it.

What Astryx gives a React project

Meta published Astryx as an open-source beta in June 2026. It supplies React 19+ components, compiled CSS and themes built on StyleX. The component defines how a control behaves, and the theme gives controls their colors, typography and spacing. A coding agent can use the same components and documentation as a developer. Meta’s Astryx introduction · Astryx repository and MIT license

That separation helps with a familiar problem. A coding agent adds a dialog to an existing website, then invents a second set of button styles and keyboard behavior. With Astryx, you can tell it which components and theme are already in the project. The project CLI’s init command writes Astryx guidance to project instruction files such as AGENTS.md, and the CLI exposes component docs and supported props. It still takes a person or a test to verify the finished screen. Astryx CLI reference

Build a reading list and change its theme

We built a reading list with React 19.2.9 and Astryx 0.7.16. The form uses Astryx’s Dialog, TextInput and Button. The Theme and Mode selectors change the theme and mode passed to the same Theme wrapper. Switching from Neutral Light to Matcha Dark changes the colors, type and button shape while keeping the three books in place.

Reading list with three books, Neutral theme and Light mode selected.
The demo in Neutral Light. The theme and mode selectors control the same reading list.
The same three books in Matcha Dark, with a dark background and rounded pale green Add book button.
The same three entries in Matcha Dark. The accent, button shape and book-title type change with the theme.

In a React project that already uses Astryx, ask the agent to work within the existing system. For example:

Add an Add book dialog with title and author fields. Use the Astryx components and theme already configured here, then check keyboard navigation and focus after Escape.

To try the same setup, start in a client-rendered React 19 project with Node.js 22.13 or later. Install the packages at the versions used in our demo and initialize the project guidance.

npm install --save-exact @astryxdesign/[email protected] @astryxdesign/[email protected] @astryxdesign/[email protected] @stylexjs/[email protected]
npm install --save-dev --save-exact @astryxdesign/[email protected]
npx @astryxdesign/[email protected] init

In the React entry file, keep your existing root and App. Add these imports and wrap App in Theme.

import { Theme } from '@astryxdesign/core/theme';
import { neutralTheme } from '@astryxdesign/theme-neutral';
import '@astryxdesign/core/reset.css';
import '@astryxdesign/core/astryx.css';
import '@astryxdesign/theme-neutral/theme.css';
import '@astryxdesign/theme-neutral/fonts.css';

root.render(
  <Theme theme={neutralTheme} mode="light"><App /></Theme>
);

For Matcha Dark, import matchaTheme from @astryxdesign/theme-matcha, use that package’s theme.css and fonts.css, and pass theme={matchaTheme} mode="dark". The demo keeps the reading list in React state, so it survives a theme change and resets on reload. Astryx theming guide · Astryx 0.7.16 release

Can you use Add book without a mouse?

We used Astryx’s Dialog with purpose="form" and made Title the initial focus target. Here’s what happened in Chrome when we used the keyboard:

  1. Open. Press Tab to reach Add book, then Enter. The dialog opens and focus moves to Title.
  2. Move. Press Tab to advance through the fields and buttons or Shift+Tab to go back. Focus stays inside the open dialog.
  3. Close. Press Escape. The dialog closes and the focus ring returns to Add book.
Add a book dialog with a visible focus outline on the Title field and the reading list dimmed behind it.
After pressing Enter on Add book, the Title field receives keyboard focus.
Reading list after dismissal, with a visible focus ring around the Add book button.
After Escape closes the dialog, the focus ring returns to Add book.

We also reopened the form, typed Braiding Sweetgrass and its author, and submitted it with Enter. The book appeared as the fourth entry, and focus returned to the button.

Retest those actions whenever the form changes. A new field can move the tab order, and a custom open or close handler can change where focus lands. Try a narrow screen too, especially if the form gains extra fields. Astryx focus and mobile updates

Where to start

Start locally when you already have a React codebase and want to reuse the same controls across screens. Try one screen before choosing how much of the interface to migrate. If you start prototypes in Vercel v0, Meta announced an Astryx design-system skill for v0 on November 14, 2026. It brings component guidance and templates into the project. Our screenshots come from the local React implementation. Meta’s v0 announcement

A design system helps the agent choose the pieces. Give it acceptance criteria for the form, run through the main interaction and check a dark theme. That gives you specific changes to request before the pattern spreads across the rest of the site. Related example of testing a mobile UI change

To practice that review step, follow the four-step workflow for reviewing an AI website change plan.

← Back to Tech Guides
Tech Guides
Turn a PDF Into Editable Markdown With Docling ↗