playbook/skills/thirdparty/ui-ux-pro-max/data/stacks/nuxt-ui.csv

21 KiB

1NoCategoryGuidelineDescriptionDoDon'tCode GoodCode BadSeverityDocs URL
21InstallationAdd Nuxt UI moduleInstall and configure Nuxt UI in your Nuxt projectpnpm add @nuxt/ui and add to modulesManual component importsmodules: ['@nuxt/ui']import { UButton } from '@nuxt/ui'Highhttps://ui.nuxt.com/docs/getting-started/installation/nuxt
32InstallationImport Tailwind and Nuxt UI CSSRequired CSS imports in main.css file@import tailwindcss and @import @nuxt/uiSkip CSS imports@import "tailwindcss"; @import "@nuxt/ui";No CSS importsHighhttps://ui.nuxt.com/docs/getting-started/installation/nuxt
43InstallationWrap app with UApp componentUApp provides global configs for Toast Tooltip and overlays<UApp> wrapper in app.vueSkip UApp wrapper<UApp><NuxtPage/></UApp><NuxtPage/> without wrapperHighhttps://ui.nuxt.com/docs/components/app
54ComponentsUse U prefix for componentsAll Nuxt UI components use U prefix by defaultUButton UInput UModalButton Input Modal<UButton>Click</UButton><Button>Click</Button>Mediumhttps://ui.nuxt.com/docs/getting-started/installation/nuxt
68IconsUse i-{collection}-{name} format for iconsNuxt UI v4 uses Iconify i-prefix format — lucide:home is v3 legacyi-lucide-home i-heroicons-user formatlucide:home format (v3 syntax)<UButton icon="i-lucide-home"><UButton icon="lucide:home">Highhttps://ui.nuxt.com/docs/getting-started/installation/nuxt
710ThemingConfigure colors in app.config.tsRuntime color configuration without restartui.colors.primary in app.config.tsHardcoded colors in componentsdefineAppConfig({ ui: { colors: { primary: 'blue' } } })<UButton class="bg-blue-500">Highhttps://ui.nuxt.com/docs/getting-started/theme/design-system
812ThemingExtend semantic colors in nuxt.configRegister new colors like tertiary in theme.colorstheme.colors array in ui configUse undefined colorsui: { theme: { colors: ['primary', 'tertiary'] } }<UButton color="tertiary"> without configMediumhttps://ui.nuxt.com/docs/getting-started/theme/design-system
913FormsUse UForm with schema validationUForm supports Zod Yup Joi Valibot schemas:schema prop with validation schemaManual form validation<UForm :schema="schema" :state="state">Manual @blur validationHighhttps://ui.nuxt.com/docs/components/form
1014FormsUse UFormField for field wrapperProvides label error message and validation displayUFormField with name propManual error handling<UFormField name="email" label="Email"><div><label>Email</label><UInput/><span>error</span></div>Mediumhttps://ui.nuxt.com/docs/components/form-field
1115FormsHandle form submit with @submitUForm emits submit event with validated data@submit handler on UForm@click on submit button<UForm @submit="onSubmit"><UButton @click="onSubmit">Mediumhttps://ui.nuxt.com/docs/components/form
1218OverlaysUse useOverlay composable for programmatic overlaysOpen overlays programmatically — v4 API is create().open() not open(Component)overlay.create(Component).open({ props }) patternv3 overlay.open(Component) pattern (removed in v4)const modal = overlay.create(MyModal); const { result } = modal.open({ title: 'Confirm' })overlay.open(MyModal, { props: { title: 'Confirm' } })Highhttps://ui.nuxt.com/docs/components/modal
1321DashboardUse UDashboardGroup for layoutWraps dashboard components with sidebar state managementUDashboardGroup > UDashboardSidebar + UDashboardPanelManual layout flex containers<UDashboardGroup><UDashboardSidebar/><UDashboardPanel/></UDashboardGroup><div class="flex"><aside/><main/></div>Mediumhttps://ui.nuxt.com/docs/components/dashboard-group
1423TablesUse UTable with data and columns propsPowered by TanStack Table with built-in features:data and :columns propsManual table markup<UTable :data="users" :columns="columns"/><table><tr v-for="user in users">Highhttps://ui.nuxt.com/docs/components/table
1524TablesDefine columns with accessorKeyColumn definitions use accessorKey for data bindingaccessorKey: 'email' in column defString column names only{ accessorKey: 'email', header: 'Email' }['name', 'email']Mediumhttps://ui.nuxt.com/docs/components/table
1627NavigationUse UNavigationMenu for nav linksHorizontal or vertical navigation with dropdown supportUNavigationMenu with items arrayManual nav with v-for<UNavigationMenu :items="navItems"/><nav><a v-for="item in items">Mediumhttps://ui.nuxt.com/docs/components/navigation-menu
1728NavigationUse UBreadcrumb for page hierarchyAutomatic breadcrumb with NuxtLink support:items array with label and toManual breadcrumb links<UBreadcrumb :items="breadcrumbs"/><nav><span v-for="crumb in crumbs">Lowhttps://ui.nuxt.com/docs/components/breadcrumb
1829NavigationUse UTabs for tabbed contentTab navigation with content panelsUTabs with items containing slot contentManual tab state<UTabs :items="tabs"/><div><button @click="tab=1">Mediumhttps://ui.nuxt.com/docs/components/tabs
1931FeedbackUse UAlert for inline messagesStatic alert messages with icon and actionsUAlert with title description colorToast for static messages<UAlert title="Warning" color="warning"/>useToast for inline alertsMediumhttps://ui.nuxt.com/docs/components/alert
2033Color ModeUse UColorModeButton for theme toggleBuilt-in light/dark mode toggle buttonUColorModeButton componentManual color mode logic<UColorModeButton/><button @click="toggleColorMode">Lowhttps://ui.nuxt.com/docs/components/color-mode-button
2134Color ModeUse UColorModeSelect for theme pickerDropdown to select system light or dark modeUColorModeSelect componentCustom select for theme<UColorModeSelect/><USelect v-model="colorMode" :items="modes"/>Lowhttps://ui.nuxt.com/docs/components/color-mode-select
2236CustomizationConfigure default variants in nuxt.configSet default color and size for all componentstheme.defaultVariants in ui configRepeat props on every componentui: { theme: { defaultVariants: { color: 'neutral' } } }<UButton color="neutral"> everywhereMediumhttps://ui.nuxt.com/docs/getting-started/installation/nuxt
2337CustomizationUse app.config.ts for theme overridesRuntime theme customizationdefineAppConfig with ui keynuxt.config for runtime valuesdefineAppConfig({ ui: { button: { defaultVariants: { size: 'sm' } } } })nuxt.config ui.button.size: 'sm'Mediumhttps://ui.nuxt.com/docs/getting-started/theme/components
2438PerformanceEnable component detectionTree-shake unused component CSSexperimental.componentDetection: trueInclude all component CSSui: { experimental: { componentDetection: true } }ui: {} (includes all CSS)Lowhttps://ui.nuxt.com/docs/getting-started/installation/nuxt
2539PerformanceUse UTable virtualize for large dataEnable virtualization for 1000+ rows:virtualize prop on UTableRender all rows<UTable :data="largeData" virtualize/><UTable :data="largeData"/>Mediumhttps://ui.nuxt.com/docs/components/table
2640AccessibilityUse semantic component propsComponents have built-in ARIA supportUse title description label propsSkip accessibility props<UModal title="Settings"><UModal><h2>Settings</h2>Mediumhttps://ui.nuxt.com/docs/components/modal
2741AccessibilityUse UFormField for form accessibilityAutomatic label-input associationUFormField wraps inputsManual id and for attributes<UFormField label="Email"><UInput/></UFormField><label for="email">Email</label><UInput id="email"/>Highhttps://ui.nuxt.com/docs/components/form-field
2842ContentUse UContentToc for table of contentsAutomatic TOC with active heading highlightUContentToc with :linksManual TOC implementation<UContentToc :links="toc"/><nav><a v-for="heading in headings">Lowhttps://ui.nuxt.com/docs/components/content-toc
2944AI/ChatUse UChatMessages for chat UIDesigned for Vercel AI SDK integrationUChatMessages with messages arrayCustom chat message list<UChatMessages :messages="messages"/><div v-for="msg in messages">Mediumhttps://ui.nuxt.com/docs/components/chat-messages
3046EditorUse UEditor for rich textTipTap-based editor with toolbar supportUEditor with v-model:contentCustom TipTap setup<UEditor v-model:content="content"/>Manual TipTap initializationMediumhttps://ui.nuxt.com/docs/components/editor
3149LoadingUse loadingAuto on buttonsAutomatic loading state from @click promiseloadingAuto prop on UButtonManual loading state<UButton loadingAuto @click="async () => await save()"><UButton :loading="isLoading" @click="save">Lowhttps://ui.nuxt.com/docs/components/button
3250LoadingUse UForm loadingAutoAuto-disable form during submitloadingAuto on UForm (default true)Manual form disabled state<UForm @submit="handleSubmit"><UForm :disabled="isSubmitting">Lowhttps://ui.nuxt.com/docs/components/form
3351InstallationDo not manually add auto-registered modulesNuxt UI v4 auto-registers @nuxt/icon @nuxt/fonts @nuxtjs/color-modeConfigure via root-level keys in nuxt.configAdding them to modules array causes duplicate registrationicon: { /* opts */ } in nuxt.configmodules: ['@nuxt/ui', '@nuxt/icon']Highhttps://ui.nuxt.com/docs/getting-started/installation/nuxt
3452InstallationUse official templates to bootstrap projectsNuxt UI provides starter templates via nuxi initnpx nuxi init -t ui/dashboard for dashboard projectManual project setup from scratchnpx nuxi@latest init -t ui/dashboardpnpm create nuxt app (manual UI setup)Mediumhttps://ui.nuxt.com/docs/getting-started/installation/nuxt
3553IconsInstall icon collections locally for SSRLocal Iconify JSON prevents network requests and flashpnpm i @iconify-json/lucide for reliable server renderingRely on remote icon fetching in productionpnpm i @iconify-json/lucide @iconify-json/simple-iconsNo local icon packagesMediumhttps://ui.nuxt.com/docs/getting-started/installation/nuxt
3654IconsOverride default component icons globallyComponents use default icons configurable via appConfig.ui.iconsSet loading close check icons in app.config.tsAccept default icons for all componentsdefineAppConfig({ ui: { icons: { loading: 'i-lucide-refresh-cw', close: 'i-lucide-x' } } })<UModal :close-icon="'i-lucide-x'"> on every usageLowhttps://ui.nuxt.com/docs/getting-started/installation/nuxt
3755FormsUse UFileUpload for file inputBuilt-in drag-drop and preview supportUFileUpload with v-model and accept propCustom input type=file<UFileUpload v-model="files" accept="image/*" multiple/><input type="file" @change="handleFiles">Mediumhttps://ui.nuxt.com/docs/components/file-upload
3856FormsUse UInputDate for date selectionLocale-aware date picker built on UCalendarUInputDate with v-model and locale propThird-party date picker libraries<UInputDate v-model="date" /><DatePicker v-model="date" />Mediumhttps://ui.nuxt.com/docs/components/input-date
3957FormsUse UInputTags for tag inputMulti-value tag input with keyboard supportUInputTags with v-model and max propCustom chip input implementation<UInputTags v-model="tags" :max="5" /><UInput @keydown.enter="addTag">Lowhttps://ui.nuxt.com/docs/components/input-tags
4058FormsUse UColorPicker for color selectionFull-featured color picker with multiple format supportUColorPicker with v-model and format propNative input type=color<UColorPicker v-model="color" format="hex" /><input type="color" v-model="color">Lowhttps://ui.nuxt.com/docs/components/color-picker
4159DataUse UTree for hierarchical dataBuilt-in tree component with expand/collapseUTree with items prop containing nested childrenCustom recursive component<UTree :items="treeItems" /><TreeNode v-for="item in items" :key="item.id">Lowhttps://ui.nuxt.com/docs/components/tree
4260DataUse UMarquee for infinite scroll contentAnimated infinite scroll band for logos or testimonialsUMarquee with repeat and pauseOnHover propsCSS animation keyframes loop<UMarquee :repeat="3" pause-on-hover><div class="animate-marquee">Lowhttps://ui.nuxt.com/docs/components/marquee
4362OverlaysAwait overlay result for confirmation dialogsuseOverlay returns a result Promise resolving to user actionawait instance.result to get confirm/cancelEmit events from overlay componentsconst { result } = modal.open(); if (await result) { deleteItem() }overlay.open(Confirm, { onConfirm: deleteItem })Mediumhttps://ui.nuxt.com/docs/components/modal
4463NavigationUse UCommandPalette with grouped itemsCommand palette supports grouped search with icons and kbdsgroups array with id label itemsFlat list without categories<UCommandPalette :groups="[{ id: 'actions', label: 'Actions', items }]"/><UCommandPalette :items="flatList"/>Mediumhttps://ui.nuxt.com/docs/components/command-palette
4564NavigationUse defineShortcuts with extractShortcutsWire keyboard shortcuts from menu item kbds automaticallyextractShortcuts(items) + defineShortcuts to sync keybindingsManually duplicate shortcuts from menu itemsdefineShortcuts(extractShortcuts(items))defineShortcuts({ meta_n: () => newFile() }) // duplicated from itemsLowhttps://ui.nuxt.com/docs/composables/define-shortcuts
4665LayoutUse UHeader and UFooter for page layoutResponsive header/footer with built-in mobile menuUHeader with #default slot for nav UFooter with columnsCustom header/footer from scratch<UHeader><template #right><UNavigationMenu/></template></UHeader><header class="sticky top-0">Lowhttps://ui.nuxt.com/docs/components/header
4766LayoutUse UPageAside for sidebar contentSidebar that hides below lg breakpoint automaticallyUPageAside for docs and landing page sidebarsManual hidden lg: classes<UPageAside><UNavigationMenu orientation="vertical"/></UPageAside><aside class="hidden lg:block">Lowhttps://ui.nuxt.com/docs/components/page-aside
4868ThemingRead generated theme file to find slot namesNuxt UI generates theme files listing all component slots and variantsCheck .nuxt/ui/<component>.ts for slot namesGuess slot names or use trial-and-error.nuxt/ui/button.ts for UButton slot names<UButton :ui="{ base: 'rounded-full' }"/> without checking slotsMediumhttps://ui.nuxt.com/docs/getting-started/theme/components
4969ComposablesUse defineShortcuts whenever keyword shortcutwhenever array condition prevents shortcut firing when inactivewhenever: [isFormValid] to guard shortcut executionAlways-on shortcuts that fire in wrong contextdefineShortcuts({ meta_enter: { handler: submit, whenever: [isFormValid] } })defineShortcuts({ meta_enter: () => submit() }) // fires even when invalidLowhttps://ui.nuxt.com/docs/composables/define-shortcuts
5070i18nUse UApp locale prop for internationalizationNuxt UI supports 50+ built-in locales via locale prop on UAppImport locale from @nuxt/ui/locale and pass to UAppManual translation of component UI stringsimport { fr } from '@nuxt/ui/locale'; // <UApp :locale="fr"><UModal title="Fermer"> manually for each componentLowhttps://ui.nuxt.com/docs/composables/define-locale