Skip to Content
Getting startedFoundationsComponentsPackagesTools

Install

Point shadcn at the registry, import the tokens once, and add the components you want as source in your own repository.

Components and tokens arrive by different routes, because they are different kinds of thing. A component is copied into your repository as source, through a shadcn registry, so you can read it and change it. The tokens underneath it are a package from npm, so a fix reaches you with a version bump rather than a re-copy.

1. Point shadcn at the registry

The @hipuku namespace goes in your components.json, once.

components.json
{
  "registries": {
    "@hipuku": "https://haus.hipuku.dev/r/{name}.json"
  }
}

Components install under components/haus/ in your source directory, and every example on these pages imports them through the @/ alias, as shadcn does. A Next.js app has that alias already. A Vite app does not. Add the same paths to tsconfig.json, which shadcn reads to place the files, and to tsconfig.app.json, which typechecks them, then the alias to vite.config.ts so the build resolves it too.

tsconfig.json and tsconfig.app.json
{
  "compilerOptions": {
    "paths": { "@/*": ["./src/*"] }
  }
}
vite.config.ts
import path from 'node:path'
import react from '@vitejs/plugin-react'
import { defineConfig } from 'vite'

export default defineConfig({
  plugins: [react()],
  resolve: { alias: { '@': path.resolve(__dirname, './src') } },
})

Keep any plugins your config already has; only resolve is new. A Vite project created before create-vite 8.0.2 also needs Node's types for node:path and __dirname: run npm install -D @types/node and add "node" to types in tsconfig.node.json.

The registry serves TypeScript. The files install exactly as written, so a project with "tsx": false in its components.json would receive TypeScript inside .js files and fail to build.

2. Install the tokens

npm install @hipuku/tokens

Import the barrel once, at the root of your app. It loads the four layers in the order they depend on each other, which a hand-written set of imports gets wrong eventually.

app/layout.tsx
import '@hipuku/tokens/index.css'

@hipuku/tokens is the name npm serves, from 6.0.0. It was haus-tokens up to 5.2.0, which has a final deprecated release pointing here and was not unpublished, so an existing install keeps working. The tokens page says where each package stands.

3. Add a component

npx shadcn add @hipuku/badge

That writes the component, its stylesheet and the types it shares with the rest of the library into your own components/ directory. Each component page carries the command that installs it, and prints it only once the registry actually serves that component.

import { Badge } from '@/components/haus/components/Badge'

export function Status() {
  return <Badge tone="success">Shipped</Badge>
}

The props follow one vocabulary across the library: variant is visual weight, tone is meaning, appearance is subtle or solid, and size is sm, md or lg. A component narrows that vocabulary to what it actually offers, and the narrowing is in the type.

4. Theme with a brand

The default brand is haus's own. To apply another, set data-haus-theme on any element, and every role inside that subtree resolves through that brand's map. The attribute nests, so two brands can sit on one page.

<div data-haus-theme="vault">
  <Badge tone="success">Shipped</Badge>
</div>

brands/vault.css is a complete second brand shipped in the token package, built against the same contract as the default. BrandMap is generated from the brand file, so a missing role is a type error.

Peer dependencies

react and react-dom, at ^18.0.0 || ^19.0.0.

The other packages

Five more packages stand on their own, and none of them is needed to use a component. Each has its own page under Packages: the motion engine, the colour maths, the token converter, the style probe and the shared configuration.

On this page