Skip to content
ProLifetime access for $199, paid once, every future release included
Truffle UI

Installation

Set up the registry once, then add components by name.

1. Set up shadcn

Skip this if your project already has a components.json.

npx shadcn@latest init

2. Add the Truffle registry

Add this to components.json. It is all you need for free components.

components.json
{
  "registries": {
    "@viewport": "https://truffle-ui.vercel.app/r/{name}.json"
  }
}

3. Add a component

npx shadcn@latest add @viewport/dock

The file is written to components/viewport/dock.tsx, its dependencies are installed and any keyframes it needs are added to your global CSS.

Pro components

Pro components use the same registry with your license key as a token. Copy the key from your dashboard, add it to .env.local, and send it as a header:

.env.local
VIEWPORT_LICENSE_KEY=LMN-XXXXX-XXXXX-XXXXX
components.json
{
  "registries": {
    "@viewport": {
      "url": "https://truffle-ui.vercel.app/r/{name}.json",
      "headers": {
        "Authorization": "Bearer ${VIEWPORT_LICENSE_KEY}"
      }
    }
  }
}

Don't commit the key. In CI, set VIEWPORT_LICENSE_KEY as a secret.

Manual install

Every component page has a Manual tab with the source, the npm dependencies and the keyframes to paste.