Getting started

Installation

Add the Trame UI registry to your project, then install components and blocks with the shadcn CLI.

Trame UI is a shadcn registry. There is no npm package to install and keep up to date: the CLI copies the source into your project, under components/trame/, with everything it needs.

Before you start

  • A Vue 3 project (Vite or Nuxt) or a React 19 project (Vite or Next.js).
  • Tailwind CSS v4.
  • A components.json at the root. If you have none, the CLI’s init makes one, but it asks questions: in a script or with an AI agent, write the file yourself instead (the MCP server gives a complete one).
npx shadcn-vue@latest init   # Vue
npx shadcn@latest init       # React
  • In tsconfig.json, allow imports with their extension. Trame’s files import ./x.ts, and without it the build fails with TS5097. Next.js, Nuxt and Vite projects already set noEmit, which it needs.
{
  "compilerOptions": {
    "allowImportingTsExtensions": true
  }
}

A project with a src/ folder

The CLI puts the files under your components alias. This page writes components/trame/…; in a project with a src/ folder, read src/components/trame/… everywhere, in the CSS imports and the React context mapping too.

1. Declare the registry

Add the @trame registry to components.json, once per project. Vue projects use the /r/vue/ address:

{
  "registries": {
    "@trame": "https://trame-ui.com/r/vue/{name}.json"
  }
}

React projects use /r/react/:

{
  "registries": {
    "@trame": "https://trame-ui.com/r/react/{name}.json"
  }
}

This is enough for components and themes. To install blocks, the registry also needs your key: see Your key.

2. Add an item

Vue uses the shadcn-vue CLI, React the shadcn CLI. The item names are the same.

A component, with its own pieces:

npx shadcn-vue@latest add @trame/button

A block, with only what it uses: its own files, its types and the components it needs:

npx shadcn-vue@latest add @trame/steps-cards

With pnpm, yarn or bun, replace npx with pnpm dlx, yarn dlx or bunx --bun. Every block and component page on this site shows its exact command, for your framework and package manager.

3. Import the styles

The first item you add brings the theme’s CSS into components/trame/styles/. Import its index.css once, in your app’s main CSS, in place of your own @import 'tailwindcss' (it imports Tailwind itself), for Vue and React alike:

@import './components/trame/styles/index.css';

It brings Tailwind, the theme (tokens, light, dark, moods, type, controls, motion) and tailwind-theme.css, which maps the utilities the blocks use (bg-brand, text-brand-foreground, rounded-pill, text-eyebrow…) to the theme. Without it those classes match nothing: a badge loses its background, a pill its shape. It also imports tw-animate-css, which the CLI adds to your dependencies.

With a theme of your own (made with the @trame-ui/tokens generator), keep your theme’s CSS and import only components/trame/styles/tailwind-theme.css after it.

Adjust the path to where your CSS file lives. See Themes to switch to another theme.

React: the context mapping

Blocks read links, words and actions from their host through #context. In a React project, add this to package.json, so the server and the client each get the right file:

{
  "imports": {
    "#context": {
      "react-server": "./components/trame/context/server.ts",
      "default": "./components/trame/context/client.tsx"
    }
  }
}

Without it, blocks fall back to a demo context without warning.

Item names

Item Name Example
A component its name button
A block its id, <category>-<name> steps-cards

A block’s id is also its file name: steps-cards installs components/trame/blocks/steps/steps-cards.vue (.tsx in React).

The code is yours

Once installed, the code belongs to your project. Edit it, rename it, delete what you do not use. Nothing upstream overwrites it; running add again asks before it replaces a file.