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 init2. Add the Truffle registry
Add this to components.json. It is all you need for free components.
{
"registries": {
"@viewport": "https://truffle-ui.vercel.app/r/{name}.json"
}
}3. Add a component
npx shadcn@latest add @viewport/dockThe 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:
VIEWPORT_LICENSE_KEY=LMN-XXXXX-XXXXX-XXXXX{
"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.