Installation
How to install Arcana UI in any React project — Vite, Next.js, Remix, or CRA.
Requirements
- React 18 or 19
- A bundler that handles CSS Modules (Vite, webpack, Next.js, Parcel)
- TypeScript 5+ (optional but recommended)
Install packages
Import design tokens
Arcana's visual system lives in @arcana-ui/tokens/dist/arcana.css. Import it once at the root of your application.
Vite / React
Next.js App Router
Next.js Pages Router
Import components
Every component is individually exported from @arcana-ui/core:
You can import them all at once — the package is tree-shakeable so only the components you use end up in the bundle.
TypeScript
All components ship with TypeScript declarations. No additional @types package needed.
CSS Modules bundler config
Arcana components use CSS Modules internally. Your bundler handles this automatically if you're using:
- Vite — works out of the box
- Next.js — works out of the box
- webpack (CRA, custom) — CSS Modules are enabled by default in
create-react-app; for custom webpack configs, ensurecss-loaderis configured withmodules: truefor*.module.cssfiles
Troubleshooting
Styles not applying
Make sure @arcana-ui/tokens/dist/arcana.css is imported before any other stylesheets. The token file sets CSS custom properties on :root that all components depend on.
SSR / hydration issues
If you see hydration mismatches with dark mode, ensure your HTML <html> element has suppressHydrationWarning (Next.js App Router) or that you apply the theme class synchronously before first paint.
Peer dependency warnings
Arcana requires React 18+. If you see peer dependency warnings about React versions, upgrade: