astryx README

The project's README from github.com/facebook/astryx. As one markdown file: README.md.

Astryx

Astryx

An open source design system that's fully customizable and built for how we build now:
by people and the agents working alongside them.

Currently in Beta · Built on React 19+ and StyleX

npm version license MIT PRs welcome

Docs Storybook Sandbox

Docs · Storybook · Sandbox · Contributing · Discord

Overview

Astryx is an open source design system that grew inside Meta over the last eight years, where it became the most-used and largest design system in the company — powering 13,000+ apps and shaped by the engineers, designers, and product teams who depend on it every day.

It ships 150+ accessible components, brand-level theming, dark mode, ready-to-ship templates, and a CLI as one cohesive system. You import pre-built CSS and use typed React components — no build plugin, no styling library to adopt — and both people and AI assistants build with the same tooling.

What makes Astryx different:

Getting Started

Astryx requires React 19 or later (react and react-dom are peer dependencies of @astryxdesign/core).

Install Astryx, a theme, and its peer dependencies:

# npm
npm install @astryxdesign/core @astryxdesign/theme-neutral @stylexjs/stylex
npm install -D @astryxdesign/cli

# pnpm
pnpm add @astryxdesign/core @astryxdesign/theme-neutral @stylexjs/stylex
pnpm add -D @astryxdesign/cli

# yarn
yarn add @astryxdesign/core @astryxdesign/theme-neutral @stylexjs/stylex
yarn add -D @astryxdesign/cli

The simplest setup is a few CSS imports plus a theme provider — no build plugin, no PostCSS or Babel config. See the @astryxdesign/core README for the full guide (Next.js, Tailwind, Vite, and CDN).

For reliable CLI access, add a script to your package.json:

"scripts": {
  "astryx": "node node_modules/@astryxdesign/cli/clients/cli/bin/astryx.mjs"
}

Then use it as npm run astryx -- component --list. This avoids path errors when AI assistants or new developers invoke the CLI directly.

Packages

Package Description README
@astryxdesign/core Components, theme system, and utilities README
@astryxdesign/cli CLI tooling: component docs, templates, scaffolding, themes, and codemods README
@astryxdesign/build Build plugins for StyleX source builds README
@astryxdesign/theme-* Seven ready-made, fully customizable themes (neutral, butter, chocolate, matcha, stone, gothic, y2k) README

@astryxdesign/lab (experimental components) is used internally for Storybook and the sandbox and is not published to npm. @astryxdesign/vega (Vega/Vega-Lite chart wrapper) and @astryxdesign/charts (chart components) are published to npm only under the @canary dist-tag — there is no stable release yet.

Principles

These are the promises Astryx makes to the people building on it.

Architecture

Foundations

The building blocks for visually cohesive and accessible interfaces: typography, color, layout, and accessibility.

Components

A library of 150+ reusable UI building blocks with full TypeScript support.

Patterns

Battle-tested design solutions for common interactions and workflows: table pages, detail page layouts, form wizards, navigation patterns, data entry flows.

Project Structure

Directory Purpose
apps/ Example apps, the docsite, and Storybook
packages/ Published packages: core, cli, build, themes
internal/ Internal tooling: test utilities, eslint plugin, vibe tests

Contributing

We welcome contributions! See CONTRIBUTING.md for the full guide.

Questions, or want a hand with a PR? Come find us in Discord.

Our conventions and review rubrics live in the Contributing wiki — including API Conventions, Design Conventions, the Component Lifecycle, and the Contributing Templates and Blog Review rubrics. Read the relevant one before opening a PR.

Quick start for contributors: this repo uses Node 22+ on an active LTS line and pnpm 11. Install pnpm directly, or enable Corepack once so the pinned pnpm version installs automatically:

corepack enable
pnpm install

If corepack is missing, install pnpm directly or install Corepack manually; see the troubleshooting notes in CONTRIBUTING.md.

License

MIT

astryx (facebook/astryx)

Searching Database…

13.7K ·GitHub
这是什么?Astryx 是一个开源的、为 AI 智能体准备好的设计系统,由 Meta 内部历经八年打造。它提供 150 多个无障碍 React 组件、品牌主题定制、深色模式、现成模板,以及一个 CLI 命令行工具,这些功能共同构成一个统一的系统。
这是框架还是组件库?它是一个以 npm 包形式发布的 React 组件库(设计系统),而不是框架。你可以直接导入预构建的 CSS 和带类型定义的 React 组件,无需采用构建插件,也无需额外的样式库。
如何将 Astryx 添加到项目中?安装 @astryxdesign/core、一个主题包(例如 @astryxdesign/theme-neutral)以及对等依赖,然后添加几条 CSS 导入语句和一个主题提供者即可。无需任何构建插件、PostCSS 或 Babel 配置。
安装之前需要准备什么?需要 React 19 或更高版本,因为 react 和 react-dom 是 @astryxdesign/core 必需的对等依赖。如果要为单体仓库(monorepo)本身贡献代码,则需要 Node 22+ 和 pnpm 11。
Astryx 的所有内容都可以用于生产环境吗?核心系统目前处于 Beta 阶段。图表相关包(@astryxdesign/vega、@astryxdesign/charts)仅以 @canary 标签发布到 npm,尚无稳定版本;@astryxdesign/lab 仅供内部使用,完全未发布。
这套系统面向哪些人?它面向正在开发 React 19 网页应用的团队,希望使用一套组件系统,让人类开发者和 AI 编程助手都能以相同的方式使用,遵循相同的 API 和文档。
Astryx 与一般的封闭式设计系统有什么不同?它的组件采用“开放内部结构”:构建模块可以直接导出用于组合,并且 swizzle CLI 命令可以将某个组件的完整源码导出到你的项目中,让你完全拥有并可编辑它。
Astryx 会把我限定在某种特定的样式方案吗?不会。Astryx 内部使用 StyleX 编写自己的样式,但这对使用者不可见。你可以通过 className 使用 Tailwind、CSS Modules 或普通 CSS 覆盖组件样式。
如何在不分叉组件的情况下自定义外观?Astryx 中的主题只是一组 CSS 自定义属性的覆盖,因此无需包装或分叉组件源码,就能重新设计整个系统的样式。
开箱即用的主题有哪些?内置七套现成的主题,均可完全自定义:neutral、butter、chocolate、matcha、stone、gothic 和 y2k。
Creator
facebook
Size
1.1 GB
Stars
13.7K
Age
9mo
Commits · 90 Days