Index of every page on this site: llms.txt
All skills
nuxt avatar

/nuxt-ui

@bcc09c0 official
by nuxtnuxt/ui7k stars
1,152
Run it yourself

Build UIs with @nuxt/ui v4 — 125+ accessible Vue components with Tailwind CSS theming. Use when creating interfaces, customizing themes to match a brand, building forms, or composing layouts like dashboards, docs sites, and chat interfaces.

Use this Skill: https://skilld.dev/gh/nuxt/ui/nuxt-ui

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referenceslayoutschat.md

≈1.9k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Chat Layout

Build AI chat interfaces with message streams, reasoning, tool calling, and Vercel AI SDK integration.

When to use

  • AI chatbot interfaces
  • Customer support chat
  • Any conversational UI with streaming responses

Setup

Install dependencies

Nuxt:

pnpm add ai @ai-sdk/vue @comark/nuxt

Vue (Vite):

pnpm add ai @ai-sdk/vue @comark/vue

Register Comark module

Nuxt:

export default defineNuxtConfig({
  modules: [
    '@nuxt/ui',
    '@comark/nuxt'
  ]
})

Vue (Vite): No module registration needed, import directly from @comark/vue.

@comark/nuxt (or @comark/vue for Vue projects) provides the Comark component used to render AI responses as streaming Markdown, it incrementally renders tokens as they arrive and automatically enables Nuxt UI's prose components.

Dark mode for syntax highlighting

When using the highlight plugin, add the following CSS to your stylesheet:

html.dark .shiki span {
  color: var(--shiki-dark) !important;
  background-color: var(--shiki-dark-bg) !important;
  font-style: var(--shiki-dark-font-style) !important;
  font-weight: var(--shiki-dark-font-weight) !important;
  text-decoration: var(--shiki-dark-text-decoration) !important;
}

Server endpoint

These examples target AI SDK v7 (instructions, toUIMessageStream).

Using Vercel AI Gateway (recommended):

import { streamText, convertToModelMessages, toUIMessageStream, createUIMessageStreamResponse } from 'ai'

export default defineEventHandler(async (event) => {
  const { messages } = await readBody(event)

  const result = streamText({
    model: 'anthropic/claude-sonnet-5.5',
    instructions: 'You are a helpful assistant.',
    messages: await convertToModelMessages(messages)
  })

  const stream = toUIMessageStream({ stream: result.stream })
  return createUIMessageStreamResponse({ stream })
})

Or with a direct provider (e.g., pnpm add @ai-sdk/openai):

import { streamText, convertToModelMessages, toUIMessageStream, createUIMessageStreamResponse } from 'ai'
import { openai } from '@ai-sdk/openai'

export default defineEventHandler(async (event) => {
  const { messages } = await readBody(event)

  const result = streamText({
    model: openai('gpt-5-nano'),
    instructions: 'You are a helpful assistant.',
    messages: await convertToModelMessages(messages)
  })

  const stream = toUIMessageStream({ stream: result.stream })
  return createUIMessageStreamResponse({ stream })
})

Component tree

UDashboardPanel
├── #header → UDashboardNavbar
├── #body → UContainer → UChatMessages
│                         ├── #part → UChatReasoning, UChatTool, Comark
│                         └── #indicator (loading)
└── #footer → UContainer → UChatPrompt
                            └── UChatPromptSubmit

Full page chat

<script setup lang="ts">
import { isReasoningUIPart, isTextUIPart, isToolUIPart, getToolName } from 'ai'
import { useChat } from '@ai-sdk/vue'
import { isPartStreaming, isToolStreaming } from '@nuxt/ui/utils/ai'
import highlight from '@comark/nuxt/plugins/highlight'

definePageMeta({ layout: 'dashboard' })

const input = ref('')

const { messages, status, error, sendMessage, stop, regenerate } = useChat({
  onError(error) {
    console.error(error)
  }
})

function onSubmit() {
  if (!input.value.trim()) return
  sendMessage({ text: input.value })
  input.value = ''
}
</script>

<template>
  <UDashboardPanel>
    <template #header>
      <UDashboardNavbar title="Chat" />
    </template>

    <template #body>
      <UContainer>
        <UChatMessages :messages="messages" :status="status">
          <template #part="{ part, message, streaming }">
            <UChatReasoning
              v-if="isReasoningUIPart(part)"
              :text="part.text"
              :streaming="isPartStreaming(part, streaming)"
            >
              <Comark
                :markdown="part.text"
                :streaming="isPartStreaming(part, streaming)"
                :plugins="[highlight()]"
                class="*:first:mt-0 *:last:mb-0"
              />
            </UChatReasoning>

            <UChatTool
              v-else-if="isToolUIPart(part)"
              :text="getToolName(part)"
              :streaming="isToolStreaming(part, streaming)"
              :error="part.state === 'output-error'"
            />

            <Comark
              v-else-if="isTextUIPart(part) && message.role === 'assistant'"
              :markdown="part.text"
              :streaming="isPartStreaming(part, streaming)"
              :plugins="[highlight()]"
              class="*:first:mt-0 *:last:mb-0"
            />
          </template>
        </UChatMessages>
      </UContainer>
    </template>

    <template #footer>
      <UContainer class="pb-4 sm:pb-6">
        <UChatPrompt v-model="input" :error="error" @submit="onSubmit">
          <UChatPromptSubmit :status="status" @stop="stop()" @reload="regenerate()" />
        </UChatPrompt>
      </UContainer>
    </template>
  </UDashboardPanel>
</template>

Key components

  • UChatMessages — scrollable message list with auto-scroll. Props: messages, status. Slots: #part (per part, unrendered parts fall back to the default output), #content (per message), #actions, #indicator.
  • UChatMessage — individual bubble. Props: message, side ('left'/'right').
  • UChatReasoning — collapsible reasoning block. Auto-opens during streaming, auto-closes when done. Use isPartStreaming(part, streaming) from @nuxt/ui/utils/ai, with streaming from the #part slot.
  • UChatTool — tool invocation status. Use isToolStreaming(part, streaming). Variants: 'inline' (default), 'card'.
  • UChatPrompt — enhanced textarea for chat. Its typed API exposes a selected subset of UTextarea props, forwards additional attributes to the underlying textarea, and adds chat-specific props such as error and submitOnEnter.
  • UChatPromptSubmit — submit button with automatic status handling (send/stop/reload).
  • UChatPalette — layout wrapper for chat inside overlays.

Chat in a modal

<UModal v-model:open="isOpen">
  <template #content>
    <UChatPalette>
      <UChatMessages :messages="messages" :status="status" />

      <template #prompt>
        <UChatPrompt v-model="input" @submit="onSubmit">
          <UChatPromptSubmit :status="status" />
        </UChatPrompt>
      </template>
    </UChatPalette>
  </template>
</UModal>

With model selector

<UChatPrompt v-model="input" @submit="onSubmit">
  <UChatPromptSubmit :status="status" />

  <template #footer>
    <USelect
      v-model="model"
      :icon="models.find(m => m.value === model)?.icon"
      placeholder="Select a model"
      variant="ghost"
      :items="models"
    />
  </template>
</UChatPrompt>

Conversation sidebar

Combine with dashboard layout for a ChatGPT-like interface:

<template>
  <UDashboardGroup>
    <UDashboardSidebar collapsible resizable>
      <template #header>
        <UButton icon="i-lucide-plus" label="New chat" block />
      </template>

      <template #default>
        <UNavigationMenu :items="conversations" orientation="vertical" />
      </template>
    </UDashboardSidebar>

    <slot />
  </UDashboardGroup>
</template>

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts10d5 checks · Risk SAFE
  • Gen Agent Trust Hub10d

    The skill provides comprehensive documentation and development patterns for the Nuxt UI v4 component library. It includes configurations for official MCP servers and code recipes for common UI tasks using standard, well-known web technologies.

  • Socket10d

    No alerts

  • Snyk10d

    Risk: LOW · No issues

  • Runlayer8mo

    9 files scanned · No issues

  • ZeroLeaks6mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at bcc09c0. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 5 days ago.

Activeupdated 3 months ago
  • Nuxt
  • Vue
  • tailwindcss
  • components
  • ui
  • forms
  • theming
  • accessibility

README badge

README badge for nuxt/ui

Provides 125+ accessible Vue components built on Tailwind CSS and Reka UI, with semantic color tokens and theming support. Use for building interfaces in Nuxt, Vue, Laravel Inertia, or AdonisJS — forms, dashboards, documentation sites, and chat UIs.

Generated from the current SKILL.md.

Does this work with Vue outside of Nuxt?
Yes. @nuxt/ui v4 works with Vue (Vite), Laravel (Vite + Inertia), and AdonisJS (Vite + Inertia). Installation differs slightly but uses the same component library.
How do I find out what props and slots a component accepts?
Use the Nuxt UI MCP server with the `get_component` tool for full documentation, or `get_component_metadata` for a lightweight props/slots/events reference. The skill also points you to generated theme files in `.nuxt/ui/<component>.ts`.
Can I customize the theme to match my brand?
Yes. The skill includes a design-system reference that covers semantic colors, theming, and brand customization. Components use semantic color names like `text-default` and `bg-elevated` rather than raw Tailwind colors.
What if I need help building a specific layout like a dashboard or docs site?
The skill includes full layout references for dashboards, docs sites, landing pages, chat interfaces, and editors. Load the relevant reference file before coding to follow the established patterns.
Does this include form validation?
Yes. The forms reference covers validation, field layout, error handling, and Standard Schema integration for both client and server-side validation.

Generated from the current SKILL.md. These answers refresh after source changes.