This guide follows Installation step by step for a Vue project on Vite. Vue projects use the
shadcn-vue CLI and the /r/vue/ registry. A Vite project keeps its code in src/, so every Trame path below starts
with src/.
1. Add Tailwind CSS v4
Trame UI needs Tailwind CSS v4. If your project does not have it yet, follow Tailwind’s Vite guide:
npm install tailwindcss @tailwindcss/vite
// vite.config.ts
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import tailwindcss from '@tailwindcss/vite'
export default defineConfig({
plugins: [vue(), tailwindcss()],
})
2. Set up the @ alias
The shadcn-vue CLI places files through the aliases of components.json (@/components…), so @ must point to
src/. Follow shadcn-vue’s Vite guide for the paths in your
tsconfig and the resolve.alias in vite.config.ts. Trame’s own files import each other by relative paths and do not
depend on the alias.
3. Allow imports with their extension
Trame’s files import ./x.ts. Without this option, the build fails with TS5097. Vite’s templates keep the app’s
options in tsconfig.app.json; set it there (it needs noEmit, which Vite’s templates already set):
{
"compilerOptions": {
"allowImportingTsExtensions": true
}
}
4. Write components.json
npx shadcn-vue@latest init asks questions. You can write components.json at the root yourself instead:
{
"$schema": "https://shadcn-vue.com/schema.json",
"style": "new-york",
"typescript": true,
"tailwind": { "config": "", "css": "src/style.css", "baseColor": "neutral", "cssVariables": true },
"aliases": {
"components": "@/components",
"ui": "@/components/ui",
"lib": "@/lib",
"utils": "@/lib/utils",
"composables": "@/composables"
},
"iconLibrary": "lucide",
"registries": {
"@trame": {
"url": "https://trame-ui.com/r/vue/{name}.json",
"headers": { "Authorization": "Bearer ${TRAME_KEY}" }
}
}
}
Set tailwind.css to your main CSS file (src/style.css or src/assets/main.css, depending on how the project was
made).
5. Put your key in .env
Components and themes install without a key. Blocks need one. Create it in your dashboard, then:
TRAME_KEY=trame_your_key_here
Keep .env out of git. See Your key.
6. Add an item
Run the CLI from the project root:
npx shadcn-vue@latest add @trame/steps-cards
The files land in src/components/trame/.
7. Import the styles
In your main CSS, replace @import 'tailwindcss'; with Trame’s index.css. It imports Tailwind itself:
/* src/style.css */
@import './components/trame/styles/index.css';
The path is relative to the CSS file: from src/assets/main.css, it is ../components/trame/styles/index.css.
8. Use the block
<script setup lang="ts">
import StepsCards from '@/components/trame/blocks/steps/steps-cards.vue'
</script>
<template>
<StepsCards
title="How it works"
:steps="[{ title: 'Choose a plan' }, { title: 'Set up your account' }, { title: 'Invite your team' }]"
/>
</template>
Without a host context, blocks use a demo one: links point to #action. Give them yours, as
Using blocks shows.