Home
cd ../playbooks
Developer ToolsBeginner

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.

5 minutes
By NuxtSource
#nuxt#vue#tailwind-css#ui-components#nuxt-ui#frontend

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

CLAUDE.md Template

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.

README.md

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 class override — 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.

$Related Playbooks

Developer Tools

Office MCP Server Setup

MCP server with 39 tools for Word, Excel, PowerPoint, PDF, OCR operations

10 minutes
Intermediate
Developer Tools

Tech Debt Analyzer

Identify, analyze, document, and track technical debt in JavaScript/TypeScript codebases with automated detection and prioritized remediation plans.

10 minutes
Intermediate
Developer Tools

Test Specialist

Comprehensive JavaScript/TypeScript testing guidance with test writing, bug analysis, coverage analysis, and proactive issue detection.

10 minutes
Intermediate
Developer Tools

Accessibility Engineering for Components

Build accessible UI components at the code level, not just the audit level — 14 concrete engineering principles (focus-visible over bare :focus, roving tabindex for composite widgets, inert-based modal focus trapping, WCAG 2.5.8 hit-area minimums), a common-mistakes table with fixes, and a severity-rated review format ending in a hard Block/Needs-changes/Approve verdict.

5 minutes
Intermediate
Developer Tools

Adversary Emulation: MuddyWater

An intelligence-grounded, authorized purple-team emulation profile for MuddyWater (MITRE ATT&CK G0069), Iran's MOIS-linked cyber-espionage group — attribution, targeting, representative TTPs by ATT&CK tactic, emulation guidance mapped to generic red-team tooling, and paired detection/defense recommendations for every offensive technique, all under an explicit authorized-use caveat.

15 minutes
Advanced
Developer Tools

Adversary Emulation: Turla

An intelligence-grounded, authorized purple-team emulation profile for Turla (MITRE ATT&CK G0010), Russia's FSB-linked espionage group — attribution, distinctive TTPs (satellite C2 hijacking, steganographic email backdoors, parasitizing rival APT infrastructure), emulation guidance mapped to generic red-team tooling, and paired detection recommendations, under an explicit authorized-use and lab-only caveat for rootkit techniques.

15 minutes
Advanced
Developer Tools

AI Agent Red Team Methodology

A first-principles methodology for authorized red-team exercises against AI products, agents, MCP servers, skills, and repositories — capability and trust-boundary modeling, AI-specific attack hypothesis families (prompt injection, tool misuse, data leakage, SSRF), harmless-proof testing with canaries, one-variable-at-a-time adaptive iteration, and business-language evidence-based reporting.

10 minutes
Advanced
Developer Tools

Contribution PR Review

Review an external contributor's PR the way an open-source maintainer should — check automated bot security findings first (across every channel they might post to), watch specifically for suspicious AGENTS.md or workflow-permission changes, scale size and test-coverage expectations by contributor experience, and separate intent/scope alignment from code quality that bots already covered.

10 minutes
Intermediate
Developer Tools

Datadog Error Triage to PR

Take Datadog Error Tracking issues from raw occurrence counts to a reviewable, tested PR — a five-class bug taxonomy that filters out infra noise and deploy-skew before ranking, a recency premium that catches fresh regressions early, a mandatory approval gate before any fix is written, and a test-first fix workflow that generalizes past the one reported occurrence.

10 minutes
Advanced
Developer Tools

React Native Video (v6 & v7)

Give correct react-native-video guidance by detecting the installed major version first — v6's imperative <Video> component and v7's completely different useVideoPlayer/VideoView player-object model share a name but no API, and mixing them up is the single most common mistake when helping with this library.

5 minutes
Intermediate
Developer Tools

React Three Fiber Animation Reference

Animate React Three Fiber scenes correctly — useFrame fundamentals with render priority, full GLTF animation control via useAnimations (playback, crossfade, event listeners, speed-based blending between Idle/Walk/Run), @react-spring/three physics animations with gesture and chain integration, and the five performance rules that keep per-frame updates from triggering React re-renders.

10 minutes
Intermediate
Developer Tools

Reshape PR Commits

Turn a branch's messy WIP/fixup commit history into a clean, logically-grouped set of commits before review — proposed regrouping with explicit approval, git reset --soft plus staged re-commits instead of interactive rebase, and hard guardrails (feature branches only, force-with-lease only, never touch another author's commits).

5 minutes
Intermediate

Browse all Developer Tools playbooks →