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.

referencesguidelinesforms.md

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

Forms

Basic pattern

Nuxt UI forms use UForm + UFormField + Standard Schema validation (Zod, Valibot, Yup, or Joi).

<script setup lang="ts">
import * as z from 'zod'
import type { FormSubmitEvent } from '@nuxt/ui'

const schema = z.object({
  email: z.email('Invalid email'),
  password: z.string().min(8, 'Min 8 characters')
})

type Schema = z.output<typeof schema>
const state = reactive<Partial<Schema>>({ email: '', password: '' })

function onSubmit(event: FormSubmitEvent<Schema>) {
  // UForm validates before emitting @submit — access validated data via event.data
}
</script>

<template>
  <UForm :schema="schema" :state="state" class="space-y-4" @submit="onSubmit">
    <UFormField name="email" label="Email" required>
      <UInput v-model="state.email" type="email" placeholder="you@example.com" />
    </UFormField>

    <UFormField name="password" label="Password" required>
      <UInput v-model="state.password" type="password" placeholder="Min 8 characters" />
    </UFormField>

    <UButton type="submit" label="Sign in" />
  </UForm>
</template>

Key rules

  • Always use UFormField around inputs — it connects validation errors via the name prop
  • The name prop on UFormField must match the schema field name exactly
  • Use reactive<Partial<Schema>>({}) for state — Partial allows empty initial values
  • @submit only fires when validation passes
  • For nested objects, use dot notation: name="address.city"

UFormField props

Prop Purpose
name Links to schema field for validation errors
label Visible label text
description Help text below the input
hint Right-aligned hint text (e.g., "Optional")
required Shows required indicator
size Inherits to child input

Field layout patterns

Vertical stack (default)

<UForm :schema="schema" :state="state" class="space-y-4">
  <UFormField name="name" label="Name">
    <UInput v-model="state.name" />
  </UFormField>
  <UFormField name="email" label="Email">
    <UInput v-model="state.email" />
  </UFormField>
</UForm>

Inline fields with UFieldGroup

<UFieldGroup>
  <UFormField name="firstName" label="First name">
    <UInput v-model="state.firstName" />
  </UFormField>
  <UFormField name="lastName" label="Last name">
    <UInput v-model="state.lastName" />
  </UFormField>
</UFieldGroup>

Grid layout

<UForm :schema="schema" :state="state" class="grid grid-cols-2 gap-4">
  <UFormField name="firstName" label="First name">
    <UInput v-model="state.firstName" />
  </UFormField>
  <UFormField name="lastName" label="Last name">
    <UInput v-model="state.lastName" />
  </UFormField>
  <UFormField name="email" label="Email" class="col-span-2">
    <UInput v-model="state.email" type="email" />
  </UFormField>
</UForm>

Common field patterns

Select

<UFormField name="role" label="Role">
  <USelect v-model="state.role" :items="['Admin', 'Editor', 'Viewer']" placeholder="Choose role" />
</UFormField>

Checkbox

<UFormField name="terms">
  <UCheckbox v-model="state.terms" label="I agree to the terms and conditions" />
</UFormField>

Radio group

<UFormField name="plan" label="Plan">
  <URadioGroup
    v-model="state.plan"
    :items="[
      { label: 'Free', value: 'free', description: 'For personal projects' },
      { label: 'Pro', value: 'pro', description: 'For teams' }
    ]"
  />
</UFormField>

Switch

<UFormField name="notifications" label="Email notifications">
  <USwitch v-model="state.notifications" />
</UFormField>

Textarea

<UFormField name="bio" label="Bio" description="Brief description for your profile.">
  <UTextarea v-model="state.bio" :rows="3" autoresize :maxrows="6" />
</UFormField>

File upload

<UFormField name="avatar" label="Avatar">
  <UFileUpload v-model="state.avatar" accept="image/*" />
</UFormField>

<!-- Or as a drop area -->
<UFormField name="documents" label="Documents">
  <UFileUpload v-model="state.documents" multiple variant="area" />
</UFormField>

Date

<UFormField name="date" label="Date">
  <UInputDate v-model="state.date" />
</UFormField>

<!-- Date range -->
<UFormField name="dateRange" label="Date range">
  <UInputDate v-model="state.dateRange" range />
</UFormField>

Programmatic validation

<script setup lang="ts">
const form = useTemplateRef('form')

async function validateAndSubmit() {
  const result = await form.value?.validate({ silent: true })
  if (result) {
    // valid — submit
  }
}

async function validateEmail() {
  await form.value?.validate({ name: 'email', silent: true })
}

function setServerError() {
  form.value?.setErrors([
    { name: 'email', message: 'Email already taken' }
  ])
}

function resetErrors() {
  form.value?.clear()
}
</script>

<template>
  <UForm ref="form" :schema="schema" :state="state" @submit="onSubmit">
    <!-- fields -->
  </UForm>
</template>

By default, validate() throws a FormValidationException when validation fails. Pass { silent: true } when you want it to return false instead. Use clear() to remove validation errors.

Form in a modal

Use #footer="{ close }" scoped slot for cancel/submit actions. Wrap the modal body in UForm with a type="submit" button in the footer so validation runs on submit.

<UModal v-model:open="isOpen" title="Edit profile" description="Update your information." :ui="{ footer: 'justify-end' }">
  <template #body>
    <UForm id="profile-form" :schema="schema" :state="state" class="space-y-4" @submit="onSave">
      <UFormField name="name" label="Name">
        <UInput v-model="state.name" />
      </UFormField>
      <UFormField name="email" label="Email">
        <UInput v-model="state.email" type="email" />
      </UFormField>
    </UForm>
  </template>
  <template #footer="{ close }">
    <UButton label="Cancel" color="neutral" variant="outline" @click="close" />
    <UButton type="submit" form="profile-form" label="Save" />
  </template>
</UModal>

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.