# @primecoderin/fast-ui-react 1.0.0: full documentation > A React 19 design system on Base UI and Tailwind CSS 4. This file holds the guides and the component reference in one document. - Import from `@primecoderin/fast-ui-react`. Form fields bound to react-hook-form come from `@primecoderin/fast-ui-react/forms`, charts from `@primecoderin/fast-ui-react/charts`, the rich text editor from `@primecoderin/fast-ui-react/editor` and `@primecoderin/fast-ui-react/editor-forms`. Plain form fields (`TextField`, `SelectField` ...) are in the main entry and need no form library. - Import `@primecoderin/fast-ui-react/styles.css` once at the app's entry and wrap the app in `DesignSystemProvider`. The app needs no Tailwind and no font of its own. - Components hold no text of their own: every string a user reads (labels, hints, error messages, button names) is a prop, so pass the app's translated text. Give an icon-only control an `aria-label`. - Props follow `value` / `onValueChange`, `checked` / `onCheckedChange`, `open` / `onOpenChange`. Use `aria-label`, never `ariaLabel`. - Style with tokens, not colour values: `bg-primary`, `text-fg-secondary`, `border-line`. Tailwind's own palette (`bg-red-500`) and type scale are switched off. - Components are Client Components (they start with "use client"), so Server Components can import them. The pure helpers (`createTheme`, `cn`) are safe in Server Components. - Do not invent props or exports: check `components.md` (or the MCP server's `get_export`) for the real ones. # Getting started ```bash npm install @primecoderin/fast-ui-react ``` The package needs React 19 in the app (`react` and `react-dom`, which a React app already has). Everything else, Base UI included, comes with it. Three features live in their own entries, so an app that does not use them never installs, downloads or bundles what they need: | You use | Import from | Also install | | ------------------------------------------------------------------------------ | ------------------------------------------ | ------------------------------------------------------------------------------ | | Components, patterns, theming | `@primecoderin/fast-ui-react` | nothing | | Form fields bound to react-hook-form (Forms (the "Forms" section)) | `@primecoderin/fast-ui-react/forms` | `react-hook-form` 7.91 or later 7.x | | Charts (Charts (the "Charts" section)) | `@primecoderin/fast-ui-react/charts` | `recharts` 3.11 or later 3.x | | The rich text editor (Advanced components (the "Advanced components" section)) | `@primecoderin/fast-ui-react/editor` | `@tiptap/core @tiptap/pm @tiptap/react @tiptap/starter-kit`, 3.35 or later 3.x | | The rich text editor as a form field | `@primecoderin/fast-ui-react/editor-forms` | the TipTap packages and `react-hook-form` | These are optional peer dependencies with those ranges (`peerDependencies` in `package.json`): an app on Recharts 2 or TipTap 2 gets a peer-dependency warning from npm and must upgrade to use that entry. **1. Import the stylesheet once**, at the app's entry. It carries the font, the tokens, the base rules and every Tailwind class the components use, so the app needs no Tailwind and no font of its own: ```ts import "@primecoderin/fast-ui-react/styles.css"; ``` The font is Inter, served from the package's own files (`dist/fonts/`): no `` to add and no request to another site, so a Content-Security-Policy of `font-src 'self'` allows it. One variable file per character set covers every weight, and a browser downloads only the files whose characters a page shows (47 KB for English), and none if the app sets another font with `createTheme`. A right-to-left page uses Arial instead, since Inter has no Hebrew or Arabic. The font's licence (SIL Open Font License) ships next to it. **2. Wrap the app in the provider.** It sets `data-theme` and `dir` on ``, applies tenant branding, and hosts the toaster and the shared tooltip delay. ```tsx import { Button, DesignSystemProvider } from "@primecoderin/fast-ui-react"; export const App = () => ( ); ``` ## Vite and other frameworks - **Vite** needs no plugin and no configuration: the same three steps. The package's own Storybook runs on Vite. - **Next.js** has its own page (the "Next.js" section). - **React Router, Remix, TanStack Start, Astro and others** are not tested yet. The package is ESM, ships plain CSS and starts its components with `"use client"`, so any React 19 app whose bundler imports a `.css` file should work. Please report a problem with the framework and its version. ## Next steps - **Your brand and fonts:** Theme, branding and tokens (the "Theme, branding and tokens" section). - **Next.js:** Next.js (the "Next.js" section) (Server Components, `"use client"`, App Router and Pages Router). - **Forms:** Forms (the "Forms" section), plain fields and react-hook-form fields. - **Styling one component:** Styling and customization (the "Styling and customization" section); types: TypeScript (the "TypeScript" section). - **Every component, with its props:** Components (the Components reference below). - **Right to left, translation, accessibility:** Internationalization (the "Internationalization" section), Accessibility (the "Accessibility" section). - **Something not working:** Troubleshooting and FAQ (the "Troubleshooting and FAQ" section). --- # Next.js The package works in the App Router and the Pages Router, with Turbopack or webpack. Every component module is marked `"use client"`, so a Server Component imports components directly; the pure helpers (`createTheme`, `cn`, `FAST_ICONS`, `TOKEN_NAMES`) are not, so a Server Component can call them too: ```tsx // app/layout.tsx: a Server Component import type { ReactNode } from "react"; import "@primecoderin/fast-ui-react/styles.css"; import { createTheme, DesignSystemProvider } from "@primecoderin/fast-ui-react"; const theme = createTheme({ branding: { primary: "#6d28d9", onPrimary: "#fff" } }); export default function RootLayout({ children }: { children: ReactNode }) { return ( {children} ); } ``` - **Event handlers stay on the client.** A component that passes `onValueChange` or `onClick` is rendered from a Client Component file, as in any Next.js app; a Server Component can render one that takes only data. - **Put `dir` on `` in the layout** as well as on the provider, so the server's HTML is already right to left. Without the steps below, the provider sets `data-theme` and the theme's `