Nuxt UI Component Guidance
Build interfaces correctly with @nuxt/ui v4 — five core rules (UApp wrapper, semantic colors, reading generated theme files for real slot names, override priority, icon naming), a task-to-focus-area routing table, the Nuxt UI MCP server for live component API lookups, and full installation for both Nuxt and standalone Vue.
Styling a Nuxt UI component with text-gray-500 instead of the semantic text-muted works fine in light mode and silently breaks dark mode — Nuxt UI's whole theming system is built on semantic color tokens, and reaching for familiar raw Tailwind palette classes out of habit is the single most common way to fight the library instead of using it.
Who it's for: Vue and Nuxt developers building UIs with @nuxt/ui v4, teams choosing between Modal and Slideover or Select and SelectMenu and unsure which fits, developers customizing Nuxt UI's theme or brand colors, anyone hitting an unexpected component style override and needing to know the actual priority order
Example
"Build a settings page with Nuxt UI" → Focus areas identified from the routing table (conventions plus form validation and field layout patterns), a UApp-wrapped app confirmed, semantic color tokens used throughout instead of raw Tailwind grays, and the Nuxt UI MCP server queried for the exact props/slots of whichever form components are needed
New here? 3-minute setup guide → | Already set up? Copy the template below.
# Nuxt UI
Build interfaces with `@nuxt/ui` v4 — a Vue component library with 125+ accessible components, built on Reka UI + Tailwind CSS + Tailwind Variants. Works with Nuxt, Vue (Vite), Laravel (Vite + Inertia), and AdonisJS (Vite + Inertia).
## Core Rules (Always Apply)
1. **Always wrap the app in `UApp`** — required for toasts, tooltips, and programmatic overlays. Accepts a `locale` prop for i18n.
2. **Always use semantic colors** — `text-default`, `bg-elevated`, `border-muted`, etc. Never use raw Tailwind palette colors like `text-gray-500`.
3. **Read generated theme files for slot names.** Nuxt: `.nuxt/ui/<component>.ts`; Vue: `node_modules/.nuxt-ui/ui/<component>.ts`. These show every slot, variant, and default class for any component — the fastest way to know a component's real API.
4. **Override priority** (highest wins): `ui` prop / `class` prop → global config → theme defaults.
5. **Icons use `i-{collection}-{name}` format** — `lucide` is the default collection. Browse at icones.js.org.
## For Component API Details
Use the Nuxt UI MCP server for props, slots, events, full documentation, and real-world examples:
```bash
claude mcp add --transport http nuxt-ui https://ui.nuxt.com/mcp
```
Key MCP tools: `search-components` (find by name/category/intent), `search-composables`, `search-icons`, `get-component` (full docs + examples), `get-component-metadata` (props/slots/events, lightweight), `get-example` (real-world code). Use the MCP for *what a component accepts* and *how its API works* — this guide is for *when to use which component* and *how to build well*.
## What to Focus On, By Task
| Task | Focus areas |
|---|---|
| Build a landing page | semantic colors/theming, coding conventions, landing-page patterns |
| Build a dashboard / admin UI | conventions, component-selection decisions (Modal vs Slideover, Select vs SelectMenu), dashboard layout patterns |
| Add a settings page | conventions, form validation and field layout |
| Create a login / signup form | conventions, form validation, auth-form patterns |
| Display data in a table | conventions, component selection, data-table patterns (filters, pagination, sorting, selection) |
| Customize theme / brand colors | semantic-color and theming conventions specifically |
| Add a chat interface | conventions, chat-layout patterns (works with the Vercel AI SDK) |
| Add a modal, slideover, or drawer | conventions, component selection (which overlay fits which interaction) |
| Build site navigation | conventions, component selection, navigation patterns (headers, sidebars, breadcrumbs, tabs) |
| Build a documentation site | conventions, docs-layout patterns (navigation + TOC) |
| Render markdown | component selection, the categorized component index |
| Add a rich text editor | conventions, editor-layout patterns |
| General UI work | conventions, component selection |
Load only what's needed for the current task — don't load everything up front.
## Installation
### Nuxt
```bash
pnpm add @nuxt/ui tailwindcss
```
```ts
// nuxt.config.ts
export default defineNuxtConfig({
modules: ['@nuxt/ui'],
css: ['~/assets/css/main.css']
})
```
```css
/* app/assets/css/main.css */
@import "tailwindcss";
@import "@nuxt/ui";
```
```vue
<!-- app.vue -->
<template>
<UApp>
<NuxtPage />
</UApp>
</template>
```
### Vue (Vite)
```bash
pnpm add @nuxt/ui tailwindcss
```
```ts
// vite.config.ts
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import ui from '@nuxt/ui/vite'
export default defineConfig({
plugins: [vue(), ui()]
})
```
```ts
// src/main.ts
import './assets/css/main.css'
import { createApp } from 'vue'
import { createRouter, createWebHistory } from 'vue-router'
import ui from '@nuxt/ui/vue-plugin'
import App from './App.vue'
const app = createApp(App)
const router = createRouter({ routes: [], history: createWebHistory() })
app.use(router)
app.use(ui)
app.mount('#app')
```
```css
/* src/assets/css/main.css */
@import "tailwindcss";
@import "@nuxt/ui";
```
```vue
<!-- src/App.vue -->
<template>
<UApp>
<RouterView />
</UApp>
</template>
```
Add `class="isolate"` to the root `<div id="app">` in `index.html`. For Inertia, use `ui({ router: 'inertia' })` in `vite.config.ts`.
Get new playbooks like this one
One email a week with new Claude Code workflows. Free, like everything here.
No spam. Unsubscribe anytime.
What This Does
A working-guide for @nuxt/ui v4 — the 125+ component Vue library built on Reka UI, Tailwind CSS, and Tailwind Variants — that separates two different needs: when to use which component and how to build well (this playbook) versus what a specific component's props and slots are (the official Nuxt UI MCP server, added with one claude mcp add command). Five core rules anchor everything: always wrap the app in UApp for toasts/tooltips/overlays to work at all, always use semantic color tokens (text-default, bg-elevated) instead of raw Tailwind palette classes so dark mode and theming actually work, read the generated theme file (.nuxt/ui/<component>.ts or node_modules/.nuxt-ui/ui/<component>.ts) for a component's real slot names instead of guessing, respect the override priority (ui/class prop → global config → theme defaults), and use the i-{collection}-{name} icon format.
A task-to-focus-area routing table tells you what to pay attention to for common jobs — a dashboard needs component-selection decisions like Modal vs. Slideover or Select vs. SelectMenu plus dashboard layout patterns; a login form needs form validation and field-layout conventions; theming work needs only the semantic-color rules. Complete installation instructions cover both a Nuxt project (module registration, CSS imports, the UApp root wrapper) and a standalone Vue + Vite setup (the Vite plugin, the Vue plugin registration, router wiring, and the Inertia-specific router option).
Quick Start
Step 1: Create a Project Folder
mkdir nuxt-ui-project && cd nuxt-ui-project
Step 2: Download the Template
Click Download above, then:
mv ~/Downloads/CLAUDE.md ./
Step 3: Build With Nuxt UI
claude
Ask Claude to build a page, form, dashboard, or component with Nuxt UI. It will apply the semantic-color and UApp-wrapper rules by default, pick the right component for the interaction (checking the routing table for what matters most to the current task), and add the Nuxt UI MCP server when it needs exact prop/slot details for a specific component.
Tips & Best Practices
- Add the Nuxt UI MCP server early in a project (
claude mcp add --transport http nuxt-ui https://ui.nuxt.com/mcp) — component APIs change across releases, and the MCP's live documentation beats relying on training-data knowledge of prop names. - When a component doesn't look right, check the generated theme file for its real slot names before reaching for a
classoverride — most "the CSS isn't applying" issues come from styling the wrong slot. - For component-choice decisions (Modal vs. Slideover, Select vs. SelectMenu, Toast vs. Alert), consult the component-selection guidance for the current task rather than picking by familiarity — Nuxt UI's components have overlapping but distinct intended use cases.
Limitations
- This playbook is guidance on when and how, not a full prop/slot/event reference — always pair it with the Nuxt UI MCP server (or the library's own docs) for exact component APIs.
- Works with Nuxt, Vue+Vite, Laravel+Inertia, and AdonisJS+Inertia specifically; other Vue meta-frameworks aren't covered by the installation steps here.
- Assumes Tailwind CSS is the styling foundation — a project on a different CSS approach would need to adopt Tailwind first.