--- trigger: glob glob: app/*.vue --- | No | Category | Guideline | Description | Do | Don't | Code Good | Code Bad | Severity | Docs URL | |----|----------|-----------|-------------|----|-------|-----------|----------|----------|----------| | 1 | Installation | Add Nuxt UI module | Install and configure Nuxt UI in your Nuxt project | pnpm add @nuxt/ui and add to modules | Manual component imports | modules: ['@nuxt/ui'] | import { UButton } from '@nuxt/ui' | High | https://ui.nuxt.com/docs/getting-started/installation/nuxt | | 2 | Installation | Import Tailwind and Nuxt UI CSS | Required CSS imports in main.css file | @import tailwindcss and @import @nuxt/ui | Skip CSS imports | @import "tailwindcss"; @import "@nuxt/ui"; | No CSS imports | High | https://ui.nuxt.com/docs/getting-started/installation/nuxt | | 3 | Installation | Wrap app with UApp component | UApp provides global configs for Toast Tooltip and overlays | wrapper in app.vue | Skip UApp wrapper | | without wrapper | High | https://ui.nuxt.com/docs/components/app | | 4 | Components | Use U prefix for components | All Nuxt UI components use U prefix by default | UButton UInput UModal | Button Input Modal | Click | | Medium | https://ui.nuxt.com/docs/getting-started/installation/nuxt | | 5 | Components | Use semantic color props | Use semantic colors like primary secondary error | color="primary" color="error" | Hardcoded colors | | | Medium | https://ui.nuxt.com/docs/getting-started/theme/design-system | | 6 | Components | Use variant prop for styling | Nuxt UI provides solid outline soft subtle ghost link variants | variant="soft" variant="outline" | Custom button classes | | | Medium | https://ui.nuxt.com/docs/components/button | | 7 | Components | Use size prop consistently | Components support xs sm md lg xl sizes | size="sm" size="lg" | Arbitrary sizing classes | | | Low | https://ui.nuxt.com/docs/components/button | | 8 | Icons | Use icon prop with Iconify format | Nuxt UI supports Iconify icons via icon prop | icon="lucide:home" icon="heroicons:user" | i-lucide-home format | | | Medium | https://ui.nuxt.com/docs/getting-started/integrations/icons/nuxt | | 9 | Icons | Use leadingIcon and trailingIcon | Position icons with dedicated props for clarity | leadingIcon="lucide:plus" trailingIcon="lucide:arrow-right" | Manual icon positioning | | Add | Low | https://ui.nuxt.com/docs/components/button | | 10 | Theming | Configure colors in app.config.ts | Runtime color configuration without restart | ui.colors.primary in app.config.ts | Hardcoded colors in components | defineAppConfig({ ui: { colors: { primary: 'blue' } } }) | | High | https://ui.nuxt.com/docs/getting-started/theme/design-system | | 11 | Theming | Use @theme directive for custom colors | Define design tokens in CSS with Tailwind @theme | @theme { --color-brand-500: #xxx } | Inline color definitions | @theme { --color-brand-500: #ef4444; } | :style="{ color: '#ef4444' }" | Medium | https://ui.nuxt.com/docs/getting-started/theme/design-system | | 12 | Theming | Extend semantic colors in nuxt.config | Register new colors like tertiary in theme.colors | theme.colors array in ui config | Use undefined colors | ui: { theme: { colors: ['primary', 'tertiary'] } } | without config | Medium | https://ui.nuxt.com/docs/getting-started/theme/design-system | | 13 | Forms | Use UForm with schema validation | UForm supports Zod Yup Joi Valibot schemas | :schema prop with validation schema | Manual form validation | | Manual @blur validation | High | https://ui.nuxt.com/docs/components/form | | 14 | Forms | Use UFormField for field wrapper | Provides label error message and validation display | UFormField with name prop | Manual error handling | |
error
| Medium | https://ui.nuxt.com/docs/components/form-field | | 15 | Forms | Handle form submit with @submit | UForm emits submit event with validated data | @submit handler on UForm | @click on submit button | | | Medium | https://ui.nuxt.com/docs/components/form | | 16 | Forms | Use validateOn prop for validation timing | Control when validation triggers (blur change input) | validateOn="['blur']" for performance | Always validate on input | | (validates on every keystroke) | Low | https://ui.nuxt.com/docs/components/form | | 17 | Overlays | Use v-model:open for overlay control | Modal Slideover Drawer use v-model:open | v-model:open for controlled state | Manual show/hide logic | | | Medium | https://ui.nuxt.com/docs/components/modal | | 18 | Overlays | Use useOverlay composable for programmatic overlays | Open overlays programmatically without template refs | useOverlay().open(MyModal) | Template ref and manual control | const overlay = useOverlay(); overlay.open(MyModal, { props }) | const modal = ref(); modal.value.open() | Medium | https://ui.nuxt.com/docs/components/modal | | 19 | Overlays | Use title and description props | Built-in header support for overlays | title="Confirm" description="Are you sure?" | Manual header content | | | Low | https://ui.nuxt.com/docs/components/modal | | 20 | Dashboard | Use UDashboardSidebar for navigation | Provides collapsible resizable sidebar with mobile support | UDashboardSidebar with header default footer slots | Custom sidebar implementation | |