Getting started
Install from npm, then wire providers and Tailwind CSS v4.
Hewn is a motion-native React component library built on React Aria, Tailwind CSS v4, and Motion. Install the packages from npm, copy components into your project with the CLI, or fetch component JSON from the live registry.
Install
Option A — use the npm package
@hewnui/ui requires React ^19.2.7 and react-dom ^19.2.7
(peerDependencies in its package.json). Pinning Motion to ^12.42.2
matches the same peers — unpinned motion can resolve to a newer major.
| Peer | Supported range |
|---|---|
react | ^19.2.7 |
react-dom | ^19.2.7 |
react-aria-components | ^1.19.0 |
motion | ^12.42.2 |
Or pull a component's source straight from the registry:
Option B — copy the source into your project (you own the code)
See the CLI reference. Install the same peers (including the
Motion pin and React ^19.2.7) when you go this path.
Tailwind CSS v4
Hewn targets Tailwind v4, which is configured in CSS rather than a
tailwind.config.js. Import Tailwind and the theme layers in your global
stylesheet. These resolve from the @hewnui/themes package installed
above.
tokens.css is required — it defines the semantic theme tokens every
component reads. The rest are opt-in: radius.css powers the global radius
scale, and the two glass layers are only needed if you use the tinted glass
material.
Tailwind v4 only generates classes it can see, so point @source at the
installed package or it will strip the component styles:
If you copied source instead, point @source at your component root (for
example components/hewn) — or omit it entirely when the files already
sit inside your default content paths.
Use Tailwind CSS v4. In Next.js (and other PostCSS setups) install
@tailwindcss/postcss. In Vite, use @tailwindcss/vite instead. Do not
configure the legacy Tailwind v3 PostCSS plugin — it will not resolve the
@import layers above.
Providers
Wrap your app once, as high as possible. Each provider owns one global concern
and writes a data-* attribute on <html> that the token layers respond to.
| Provider | Controls | Values |
|---|---|---|
ThemeProvider | Active pack and mode | forest, tide, graphite, dune, clay, ember |
MaterialProvider | Global surface material | solid, glass |
RadiusProvider | Global radius scale | sharp, soft, rounded, pill |
MotionProvider | Global motion mode | full, reduced, off |
ToastProvider | Toast queue and region | — |
Only ThemeProvider is strictly required. Add the others when you want global
control over material, radius, motion, or toasts.
Not every pack supports both modes — Dune and Clay are light-only, Ember is dark-only, and Forest, Tide, and Graphite support both. Requesting an unsupported mode falls back to the pack's first allowed mode. See Themes for the full matrix.
MotionProvider never overrides the OS. prefers-reduced-motion: reduce
caps the effective mode at reduced — a full preference cannot win. See
Motion for tokens and the transform-only contract.
First component
Next steps
- Browse the components — every free component with live examples
- Theme Lab — preview a theme across every state and variant
- Theme Studio — author your own pack from an accent seed