Installation
Install AriaX in a Vite or Next.js App Router project.
Start with a React and TypeScript project with shadcn/ui’s components.json and import aliases configured.
1. Add a component
pnpm dlx shadcn add garrettjavalia/shadcn-ariax/buttonThe CLI installs the component source, shared CSS, and required dependencies from GitHub. The selected Git revision must contain the root registry.json and its referenced source files. Append #<tag-or-commit> to the component address to select a revision.
2. Configure StyleX
Configure StyleX's official Babel + PostCSS integration once per application. Merge the following into your existing configuration if needed.
// babel.config.cjs
module.exports = {
parserOpts: {
plugins: ["typescript", "jsx"],
},
plugins: ["@stylexjs/babel-plugin"],
};The parser options let the PostCSS extraction step read TSX source. You can omit them if the Babel presets used by that step already handle TypeScript and JSX.
// postcss.config.cjs
module.exports = {
plugins: {
"@stylexjs/postcss-plugin": {
include: ["src/**/*.{js,jsx,ts,tsx}"],
},
},
};Include every directory containing your components and StyleX code.
For Vite, enable loading the Babel configuration in your existing React plugin setup:
// vite.config.ts
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
export default defineConfig({
plugins: [react({ babel: { configFile: true } })],
});Merge this into your existing Vite configuration, including your import aliases.
3. Import the styles
Import the installed stylesheet once from your application entry:
// src/main.tsx
import "./components/ui/ariax/styles/entry.css";Adjust the path to match your configured component directory. The stylesheet includes the @stylex; extraction directive.
4. Use the component
import { Button } from "@/components/ui/button";
export default function App() {
return <Button>Continue</Button>;
}Add the dark class to <html> to enable dark mode. Additional components use the same CLI installation command and share the StyleX setup.