Installation
Add the Engine to a React app: install the packages, load one stylesheet, and render a component. It works with any bundler that handles CSS imports, such as Vite or Next.js.
Requirements
- React 19 or later.
- Node 22.18 or later for the CLI and the MCP server, which read your project's TypeScript config directly.
Install
npm install @uiuxengine/react @uiuxicons/react react react-dom@uiuxengine/react brings the tokens, the core and the component definitions with it. Icons come from UI/UX Icons, imported one by one.
Load the styles
Import the stylesheet once, at your app's entry:
import "@uiuxengine/react/styles.css";It holds the tokens, both themes, the three densities and every component's CSS. Nothing else is needed to render the Engine's components.
Render a component
import { Button } from "@uiuxengine/react";
import { IconPlay } from "@uiuxicons/react/icons/play";
export function Toolbar({ run }: { run: () => void }) {
return <Button variant="primary" label="Run analysis" leadingIcon={IconPlay} onPress={run} />;
}Import icons from @uiuxicons/react/icons/<name>, one file per icon, so your bundle holds only the icons you use. The package's main entry loads all of them.
Each component's page lists its props, slots and events: see the Button.
Choose a theme and density
Without anything set, the theme follows the system's light or dark preference and the density is standard. Set them on any element, usually <html>:
<html data-theme="dark" data-density="compact">See Theming and density.
Add the CLI for blocks
Blocks, such as the Empty State, are installed as source with the CLI. Add it as a development dependency, then add a block:
npm install --save-dev @uiuxengine/cli
npx @uiuxengine/cli add empty-state
npx @uiuxengine/cli generateSee Blocks for what these commands write.
TypeScript
The Engine's packages ship their types. Block files import each other with .ts extensions, so a project that installs blocks needs one of these in tsconfig.json:
{
"compilerOptions": {
"allowImportingTsExtensions": true
}
}allowImportingTsExtensions requires noEmit or emitDeclarationOnly, which bundler setups such as Vite use already. A project that compiles with tsc uses rewriteRelativeImportExtensions instead.