Repository navigation
Releases
v4.12.0
✨ Highlights
📊 Chart component
A new Chart component built on TanStack Charts renders line, area, bar and donut charts as an SVG on the server. Series colors follow your theme and color mode through the new --ui-chart-* CSS variables:
<script setup lang="ts">
const data = [
{ month: 'January', desktop: 186, mobile: 80 },
{ month: 'February', desktop: 305, mobile: 200 },
{ month: 'March', desktop: 237, mobile: 120 }
]
</script>
<template>
<UChart
type="bar"
:data="data"
index="month"
:categories="[{ key: 'desktop', label: 'Desktop' }, { key: 'mobile', label: 'Mobile' }]"
stacked
/>
</template>Note
@tanstack/charts is an optional peer dependency, install it to use the component. When the props are not enough, the definition prop takes a full TanStack chart definition.
🌐 Automatic locale with @nuxtjs/i18n
When @nuxtjs/i18n is installed, the App component now follows the current i18n locale, and only the Nuxt UI locales matching your i18n.locales are bundled. You can drop the import * as locales pattern, which shipped every locale in the entry chunk:
- <script setup lang="ts">
- import * as locales from '@nuxt/ui/locale'
-
- const { locale } = useI18n()
- </script>
-
<template>
- <UApp :locale="locales[locale]">
+ <UApp>
<NuxtPage />
</UApp>
</template>Tip
An explicit locale prop still wins, see the i18n guide.
⚡ Lighter and faster pages
Pages now load up to 27% less JavaScript. A page no longer loads the code of components only other pages use, and overlays are lazy loaded: the menu of Header, Sidebar and DashboardSidebar, the command palette of DashboardSearch and ContentSearch, and the toasts of Toaster.
| v4.11.3 | v4.12.0 | |
|---|---|---|
| JS | 871.6 kB | 549.6 kB |
| JS (gzip) | 251.9 kB | 183.9 kB |
Note
UButton also mounts about 38% faster and each item of an open DropdownMenu about 30% faster, since link props are now picked without a reactive proxy.
🚀 Features
- App: follow the
@nuxtjs/i18nlocale (#7152) (43ba8a0) - Calendar: add
yearsPerPageprop (#7138) (cc4acae) - Chart: new component (#7022) (8b37286)
- ChatReasoning: add
autoOpenprop (#7049) (dad748e) - CheckboxGroup: add
maxprop (#7145) (63a0c05) - components: add
loopprop (#7128) (a96f56f) - components: allow controlling heading element via
asprop (#7048) (623d6d2) - ContextMenu: add
openandpressOpenDelayprops (#7148) (73c489b) - FileUpload: add
rejectevent for dropped files (#7164) (c8f5ffc) - FileUpload: support custom file items in
v-model(#6927) (a352073) - InputMenu: add default slot (#6969) (3274113)
- InputNumber: add
startingValueandallowInvalidprops (#7146) (d856ec3) - module: export prose components from
@nuxt/ui/components/prose(#7143) (5c302c3) - NavigationMenu: add
viewportprop (#7123) (4a3464e) - ProsePrompt: add
promptprop (#7172) (8c92e5f) - Sidebar: add
breakpointprop (#7155) (2113daa) - Toast: add
closeOnClickto actions (#7147) (378873a)
🐛 Bug Fixes
- App: forward
nonceprop (#7137) (9271533) - Chart: render tooltip above center slot (5cf6b3a)
- ChatMessages/ChatPromptSubmit: add accessible names to icon buttons (#7153) (3cd30e0)
- ColorModeButton: resolve label after mount (#7167) (9a12b1f)
- components: localize hardcoded accessibility labels (#7177) (fc7137c)
- components: prevent empty trailing slot when loading (#7027) (1f46ce1)
- components: spin trailing loading icon with avatar (#7168) (2fc9ba0)
- ContentSearch/DashboardSearch: handle
undefinedselection when an item is toggled off (#7170) (14f13af) - ContentToc: raise list min height (#7113) (2b535b0)
- Drawer: don't disable body pointer events with
noBodyStyles(#7150) (04f253e) - Drawer: emit
after:leaveandafter:enterwhen the animation ends (#7107) (5cd317b) - Editor: align link styles with prose (f943f20)
- FileUpload: make the
dropzoneprop reactive (#7055) (f4322e7) - Form: accept empty values in
statetype (#7165) (a59a3a3) - Kbd: avoid hydration mismatch for platform-specific keys (#7166) (78e72fb)
- Link: promote queued prefetch on interaction (#7124) (974cc0d)
- Listbox: add accessible name to listbox (#7193) (6bbb358)
- Pagination: localize
aria-labelof controls and pages (#7151) (d2d3da0) - ProseA: hide underline on focus and around inline code (3cd61ed)
- SelectMenu: keep controls outside the listbox (#7096) (ded6848)
- SelectMenu: keep menu open when focus moves outside (#7095) (26016e8)
- Slideover: only cap width from
smbreakpoint (#7156) (608a3d3) - Table: measure virtualized rows with variable heights (#7204) (0e487d6)
- Table: respect
defaultColumncell and header ([#7198](https://git...
v4.11.3
🐛 Bug Fixes
- App: apply the
dirprop to the provided locale (#6767) (93c40df) - ChatPrompt: add
method="post"to prevent input leaking via GET before hydration (#7078) (57f7699) - CheckboxGroup/RadioGroup: lift a hovered table item above its neighbors (#7073) (926097a)
- ContentSearch/DashboardSearch: use translated search label as dialog title (#7062) (3c55cf2)
- DashboardSidebar/Header: use translated toggle label as menu dialog title (#7082) (51e98da)
- EditorToolbar: use tooltip text as
aria-labelon icon-only buttons (#7009) (7f0250e) - Form: include nested forms in parent
dirtystate (#6545) (8977394) - Form: keep dirty state and validation in sync with input (#7033) (56b1156)
- Form: merge unnamed nested forms into a parent without schema (#7034) (384fdc1)
- module: detect kebab-case components in Pug templates (#7045) (42ba532)
- module: generate classes prefixed by
usePrefix(#7074) (77c92de) - module: use
@custom-variantforlightanddarkvariants (#7023) (584016b) - ProseA: only round corners on focus (3da141c)
- Select/SelectMenu: keep focus moved on selection (#7083) (6138bf0)
- Table: keep footer separator above pinned columns (#7047) (e8756fd)
- theme: drop double quotes from class strings (#7039) (5a04c6c)
- useFilter: keep labels and separators in place while sorting (#6995) (032a152)
- useOverlay: resolve every pending promise when reopened (#7057) (2f50c2e)
- utils: prevent prototype pollution in
setandsetAtPath(#7077) (4bfd115)
💚 Contributors
Full Changelog: v4.11.2...v4.11.3
v4.11.2
🐛 Bug Fixes
- components: allow partial
uioverrides on items (#6979) (c617565) - components: fall back to
mdfor custom sizes in virtualizer (#6917) (9076ca2) - DashboardNavbar: render title only when defined (#6958) (7c4c6e3)
- FieldGroup: add
defaultVariantsin theme (#6938) (0317d50) - Form: clear only the targeted field inside a nested form (#6923) (2b29c33)
- Input/Textarea: keep
0withnullableandoptionalmodifiers (#6871) (6d6737a) - InputDate/InputTime: emit focus and blur when focus enters or leaves the field (#6855) (8e4546e)
- InputMenu: ignore
multiplein autocomplete mode (#6971) (27a3ef7) - InputMenu: prevent tags input from adding the search term on enter (#6776) (b3d4342)
- InputMenu: round corners inside a FieldGroup in multiple mode (#6968) (619c732)
- Link: propagate click handler errors to Vue error handling (#6993) (074152b)
- PinInput: emit blur whenever focus leaves the group (#6858) (22efd35)
- SelectMenu/InputMenu: ignore clear button when disabled (#6986) (9ea37c1)
- SelectMenu: open menu on arrow keys (#6933) (cf9e838)
- SelectMenu: remove the inherited "Show popup" aria-label (aab2d10), closes #6962
- Table: emit
aria-sorton sortable th elements (#6879) (74ad017) - Table: inset row focus outline (#6973) (a96823d)
- Table: make rows with a select event keyboard accessible (#6838) (187c34f)
- Toaster: prevent
onClickfrom being called twice (#6980) (796f79d) - vue: resolve explicit component imports to their Vue overrides (#6999) (27a5fe4)
💚 Contributors
- @benjamincanac
- @lazerg
- @61021
- @dvd233
- @giaBaoJS
- @al1maher
- @elisterken
- @ianshk
- @mikenewbon
- @oliver139
- @zvn2060
Full Changelog: v4.11.1...v4.11.2
v4.11.1
🐛 Bug Fixes
- ChatMessages: add missing
colortouserandassistantprops (#6920) (bbf1e14) - Checkbox/RadioGroup: add
flex-wraponlistandcardvariants (#6913) (90c45a6) - Checkbox/RadioGroup: use
border-defaultoncardandtablevariants (#6884) (9bdb89b) - CommandPalette: keep astral characters intact when truncating search results (#6817) (e4cb042)
- Form: omit method attribute on nested forms (#6888) (a494a97)
- InputNumber: work uncontrolled with only a default value (#6859) (2d4782b)
- Link: restore prefetching with Nuxt 4.5 custom slot (#6921) (c4ee0ea)
- Link: wait for
onNuxtReadybefore observing visibility (#6922) (612ab1c) - NavigationMenu: avoid duplicate accordion trigger on items without
to(#6862) (726e142) - ProseCodeTree: invoke default slot from render (#6906) (fbb9e22)
- Select/SelectMenu: add responsive text size (#6903) (e791d30)
- SelectMenu: prevent search input focus on open with
autofocus: false(#6905) (6caa6a9) - Slider: emit a number for a single thumb (#6890) (3d2de0c)
- Table: exclude hidden columns from colspan (#6894) (2e8f533)
💚 Contributors
Full Changelog: v4.11.0...v4.11.1
v4.11.0
✨ Highlights
↔️ Splitter component
A new Splitter component lets you build layouts with resizable panels separated by draggable handles, with min/max sizes, collapsible panels, nesting and vertical orientation:
<script setup lang="ts">
import type { SplitterItem } from '@nuxt/ui'
const items: SplitterItem[] = [
{ slot: 'sidebar', minSize: 15, maxSize: 40, defaultSize: 25 },
{ slot: 'main', defaultSize: 75 }
]
</script>
<template>
<USplitter id="layout" :items="items" class="h-96">
<template #sidebar>
Sidebar
</template>
<template #main>
Main
</template>
</USplitter>
</template>Tip
Set the id prop when rendering on the server so ids match on hydration, and auto-save-id to persist the layout to localStorage.
📊 ProgressGroup component
A new ProgressGroup component displays multiple values as segments of a single progress bar, with a legend listing each item. Items take any theme color or a CSS color, and the status prop shows the total:
<script setup lang="ts">
import type { ProgressGroupItem } from '@nuxt/ui'
const items: ProgressGroupItem[] = [
{ label: 'System', value: 24, color: 'neutral', icon: 'i-lucide-cog' },
{ label: 'Apps', value: 8, color: 'error', icon: 'i-lucide-app-window' },
{ label: 'Multimedia', value: 42, color: 'success', icon: 'i-lucide-film' }
]
</script>
<template>
<UProgressGroup :items="items" :max="128" status />
</template>🎨 Snappier motion
Animations and movement transitions now all run on --ease-out, exits included. Override the token in your @theme to retime the whole library, see the Motion section:
@theme {
--ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}Note
prefers-reduced-motion now covers overlays too, they fade in place, and movement transitions like the Tabs indicator stop.
📦 Component detection for Vue
The @nuxt/ui/vite plugin now supports experimental.componentDetection like the Nuxt module. It scans your source and only generates the theme CSS for the components you use:
import ui from '@nuxt/ui/vite'
export default defineConfig({
plugins: [
ui({
experimental: {
componentDetection: true
}
})
]
})Note
Pass an array of component names instead to include components rendered with <component :is> that can't be detected.
🚀 Features
- CheckboxGroup/RadioGroup: support
iconin items (#6726) (07f3fe8) - ProgressGroup: new component (#6860) (14ac243)
- Splitter: new component (#6670) (ae2bd5e)
- locale: validate locales against CLDR in CLI and tests (#6826) (387ce9a)
- vue: support
experimental.componentDetection(#6731) (3a568b5)
🐛 Bug Fixes
- AuthForm: type submit payload with the schema output (#6816) (795c353)
- Calendar: correct size scale (#6832) (29f9890)
- CommandPalette: always escape search highlight to prevent XSS (#6741) (2a172ef)
- components: resolve theme props consistently in form controls (#6834) (7c74269)
- ContentToc: prevent list from collapsing (#6778) (706cfd0)
- Editor: ignore updates without document changes (#6807) (7e615e1)
- Icon: render bundled icons during SSR in Vue (#6841) (545f9e3)
- locale: correct native names and tajik language code (#6823) (e333e8d)
- locale: correct slide placeholder casing in lb (#6822) (10ec237)
- Marquee: use logical properties and drop broken vertical RTL animation (#6833) (9b08a84)
- Modal: emit transition events from overlay when
scrollable(#6786) (5afbd5c) - Slider: bind form aria attributes on thumbs instead of root (#6768) (f3c2ac2)
- Slider: forward aria attributes to the thumb (#6848) (d6c3802)
- theme: blank top-level
baseinapplyUnstyled(#6825) (3e89ea7) - theme: keep variants when replacing slot classes in app config (#6824) (0fabbe5)
- Theme: merge
classfrompropswith the component class (#6842) (731ff26) - theme: replace deprecated bare tailwind aliases (#6865) (d4f2ca0)
- theme: respect reduced motion on remaining movement transitions (ce5b1df)
- theme: unify motion easing and respect
prefers-reduced-motion(#6742) (735b264) - Tree: use logical padding for indentation (#6815) (958a3ba)
🔥 Performances
- Button/Select/SelectMenu/InputMenu: narrow reactive dependencies (#6736) (6bd1dfc)
- components: memoize tv slot invocations with simple args (#6737) (4200e80)
🌐 Locales
💚 Contributors
- @benjamincanac
- @lazerg
- @61021
- @arsalan507
- @Barbapapazes
- @danielroe
- @eitea-phil
- @hieuNV0871
- @J-Michalek
- @KQraze
- @luc122c
- @mathieutu
- @onmax
- @phat-dang
- @solidusite
- @yamachi4416
Full Changelog: v4.10.0...v4.11.0
v4.10.0
✨ Highlights
🌟 InputRating component
A new InputRating component lets you display and collect ratings, with support for half-steps, custom length, clearing, hover preview and any icon:
<script setup lang="ts">
const value = shallowRef(3.5)
</script>
<template>
<UInputRating v-model="value" :step="0.5" hoverable />
</template>📦 Bundled, offline-ready icons
Nuxt UI now embeds the icons it uses into your build, so they render straight away during SSR and work fully offline instead of being fetched from the Iconify API at runtime. As long as the collection is installed locally, this happens automatically for Nuxt UI's own icons (the lucide collection by default), on both Nuxt and pure Vue/Vite.
On Nuxt this rides on @nuxt/icon's existing client bundle. On Vue the @nuxt/ui/vite plugin gains an icon.clientBundle option to bring the same bundling to Vite, either by listing icons or by scanning your source. This is powered by the standalone Vite plugin and utils added in @nuxt/icon v2.3.0:
import ui from '@nuxt/ui/vite'
export default defineConfig({
plugins: [
ui({
icon: {
clientBundle: {
// list them explicitly...
icons: ['lucide:heart', 'simple-icons:github'],
// ...or scan your whole app
scan: true
}
}
})
]
})Tip
Install each collection you use with @iconify-json/{collection_name} so its icons can be bundled. See the Icons integration for the details.
♻️ Keep overlay state with unmountOnHide
The Modal and Slideover components now accept the unmountOnHide prop. Set it to false to keep their content mounted while closed so form state, scroll position and expensive children survive open/close cycles:
<template>
<UModal :unmount-on-hide="false">
<UButton label="Open" />
<template #content>
<!-- kept alive when the modal is closed -->
</template>
</UModal>
</template>🚀 Features
- ChatPrompt: add body slot and focus highlight (#6709) (123184b)
- ChatTool: add
actionsprop for tool approval (#6694) (1a3a9dc) - ContentSearch/DashboardSearch: support
unmountOnHideprop (#6523) (f03f98b) - ContentToc: scroll list independently and center active link (#6697) (64b9f7d)
- Drawer: add
closeandcloseIconprops (#6669) (53e88a4) - Editor: allow disabling starter kit for plain text (#6713) (76d613c)
- Empty: add
loadingandloadingIconprops (#6707) (86cd25c) - InputRating: new component (#5757) (cba2c2c)
- Modal/Slideover: support
unmountOnHideprop (#6626) (4deb61b), closes #5839 #3605 - module: pre-bundle used icons into
@nuxt/iconclient bundle (#6633) (8d46034) - Popover: support
enableTouchprop (#6626) (54125f3), closes #2346 - Prompt: add
claudeaction (#6693) (7bdcb13) - prose: configurable heading anchors and copy button (#6735) (f419731)
- ScrollArea: add
getScrollElementvirtualize option (#6650) (a84de85) - Table: add
getScrollElementvirtualize option (#6657) (7e6d0f7) - unplugin: pre-bundle used icons into the Vue/Vite build (#6635) (dcf7cbc)
🐛 Bug Fixes
- AuthForm: track password visibility per field (#6638) (0faeb92)
- BlogPost/ChangelogVersion: format date in UTC to prevent hydration mismatch (#6722) (fe5bb23)
- Button: allow inline event handlers with non-void return types (#6668) (269080a)
- Carousel: prevent reset when plugin props use inline objects (f41d11e), closes #6221
- ChatMessages: re-evaluate streaming indicator on each render (#6673) (5c986dd)
- components: forward
$attrsto root element whentoprop is absent (#6628) (d3b5f1d) - components: forward
data-slotto component root (#6643) (c9c5232) - components: respect
prefers-reduced-motionin animations (#6723) (f951529) - ContentNavigation: key items by identity to prevent leading icon flash (#6640) (09fb52b)
- defineShortcuts: add missing
arrowdownto shiftable keys (#6702) (2128414) - defineShortcuts: defer standalone shortcuts that prefix a chain (#6703) (76ee176)
- Editor: prevent suggestion menu blinking on keystroke (#6712) (7e6d8b0)
- FileUpload: add
aria-disabledattribute when disabled (#6653) (c3b2996) - inertia: make
useRoute().fullPathreactive across navigations (#6696) (c256997) - Link: apply
relprop to internal links (#6677) (276302e) - Link: fall back to original path when
localePathfails (#6637) (906e8fd) - LocaleSelect: add missing keys in emoji mapping (#6629) (fab73ab)
- module: avoid unhead v2-only
hookOncein colors plugin (#6658) (e4ca579) - SelectMenu/InputMenu: only re-highlight first item with
create-item(#6689) (a71dece) - Separator: forward fall-through attributes to root (#6641) (88baabc)
- theme: use logical properties for RTL (#6724) (3179012)
- types: type prose components in app config (...
v4.9.0
✨ Highlights
📆 Calendar month and year selection
The Calendar component gains a single type prop (date | month | year, default date) that renders it as a day, month or year picker, covering both standalone pickers and quick navigation:
<script setup lang="ts">
const value = shallowRef(new CalendarDate(2026, 6, 17))
</script>
<template>
<UCalendar v-model="value" type="month" />
</template>Tip
In date mode the heading also becomes a clickable button that cycles day → month → year, so you can jump to a month or year without clicking through prev / next repeatedly. This is controlled by the new viewControls and viewButton props and works with range.
🧭 useTour composable
The new useTour composable drives guided tours by re-anchoring a single Popover across steps. It owns the step state and resolves each step's target into a reference you bind to <UPopover>, while you keep full control over the content and navigation:
<script setup lang="ts">
const card = useTemplateRef('card')
const tour = useTour([
{ target: '#cta', title: 'Get started' },
{ target: () => card.value, title: 'Profile', side: 'right' },
{ target: null, title: 'All set' }
])
</script>
<template>
<UButton @click="tour.start()">Start tour</UButton>
<UPopover :open="tour.open.value" :reference="tour.reference.value" :dismissible="false">
<template #content>
<!-- your content + buttons -->
<UButton :disabled="!tour.hasPrev.value" @click="tour.prev()">Back</UButton>
<UButton @click="tour.next()">{{ tour.hasNext.value ? 'Next' : 'Finish' }}</UButton>
</template>
</UPopover>
</template>✂️ Override default classes
A new build-time theme.unstyled option strips Nuxt UI's default theme classes from every component, keeping only their structure and the classes you provide through class, ui or app.config.ui. This lets you bring your own design system on top of the components' logic and accessibility, or cut HTML and bundle bloat:
export default defineNuxtConfig({
modules: ['@nuxt/ui'],
css: ['~/assets/css/main.css'],
ui: {
theme: {
unstyled: true
}
}
})Warning
This strips structural classes too (positioning, transitions, flex/grid), not just cosmetic ones. Layout-heavy components like Modal, Drawer or Calendar will need you to re-supply their layout.
For more surgical control, slot classes can now be a (defaults) => classes function that replaces the slot's defaults instead of merging onto them. It receives the resolved defaults so you can reuse part of them, while plain strings keep merging exactly as before. It works in :ui, app.config.ui and <UTheme :ui>:
<template>
<UButton :ui="{ base: () => 'text-3xl font-bold' }" label="Button" />
</template>🎯 Uniform focus styles
Every component now shares a single focus-visible language: a soft outline halo tinted with the component's color (e.g. outline-primary/25), so the indicator stays consistent and accessible across every variant and color. Tab panels, scrollable regions and overlay links that browsers make focusable now show the halo too, instead of hiding focus entirely.
If you prefer one outline color across your whole app regardless of component color, a single global rule in your main.css does it:
*,
::before,
::after {
@apply outline-primary/25;
}
*:focus-visible,
*:has(> a:focus-visible) {
--tw-ring-color: var(--ui-primary);
}Note
Check out the before/after preview images in #6576.
🚀 Features
- Calendar: add month and year selection (#6582) (ca3c72e)
- ChatMessages: expose
registerMessageRef(#6275) (f99778e) - components: allow hiding
iconwithfalse(#6597) (09eb639) - ContentSearch/DashboardSearch: forward input config to command palette (#6312) (5199b7e)
- FileUpload: expose
removeFilein slots (#6492) (4da3a5d) - Modal/Slideover: add
leaveandenterevents (#6596) (006324a) - module: add
theme.unstyledoption (#6551) (a2a8bc9) - PinInput: add
separatorprop (#6392) (89b30e8) - ScrollArea: add
shadowprop (#6561) (d850ae6) - Select/SelectMenu: use
multiplein theme (#6554) (f66eb65) - Sidebar: add
transitionprop (#6484) (af80a67) - theme: allow replacing slot classes with a function (#6562) (ea576e2)
- theme: uniformize focus styles across components (#6576) (b026ca2)
- useTour: new composable (#6557) (dc05151)
- vite: add
rootoption to override.nuxt-uidirectory location (#6595) (cccb3d5)
🐛 Bug Fixes
- CommandPalette: only scroll to highlighted item when focused (#6579) (02259a6)
- Link: set default for locale prop (#6563) (e9ab758)
- module: remove inline script in SPA mode for strict CSP (#6577) (7225e9f)
- ProseCodeCollapse: cap root
max-heightinstead of toggling preheight(#6565) (52d3c45) - ProseKbd: type default slot as
VNode[](52367b1) - SelectMenu: bind
idand aria attributes on trigger (#6572) (c3bef7a) - Select: open menu on label click (#6575) (e8d18c3)
- Tabs: render active indicator during SSR (#6570) (9e5b8a6)
- templates: resolve vite root to an absolute path for #build aliases (#6586) (238e291)
🌐 Locales
💚 Contributors
- @benjamincanac
- @innocenzi
- @zAlweNy26
- @maximepvrt
- @OrbisK
- @mikenewbon
- @al1maher
- @emilsgulbis
- @martinszeltins
- @cydrickn
- @neukinal
- @hendrikheil
- @johnson-jnr
- @ReCoN-96
Full Changelog: v4.8.2...v4.9.0
v4.8.2
🐛 Bug Fixes
- Form: support setting the
nameattribute (#6539) (f8186e2) - InputMenu/SelectMenu: re-highlight first item when items change (#6538) (0414dd0)
- InputNumber/InputDate/InputTime/Calendar: restore
localeprop (#6546) (ed2f955) - module: merge custom variants into AppConfig type (#6531) (f0571c3)
Full Changelog: v4.8.1...v4.8.2
v4.8.1
🐛 Bug Fixes
- ContentSearch/DashboardSearch: proxy missing CommandPalette props (#6505) (631f5dc)
- Form: add
method="post"to prevent credential leaking via GET before hydration (#6512) (7a0825a) - Icon: avoid recursive icon resolution (#6495) (d50c121)
- locale: improve Thai translation accuracy and consistency (#6509) (5d82418)
- module: expose component theme keys in AppConfig type (#6520) (ffaf163)
- Select/SelectMenu/InputMenu: add fallback for
max-height(#6503) (f4d7cbe)
💚 Contributors
Full Changelog: v4.8.0...v4.8.1
v4.8.0
✨ Highlights
🎨 Theme component prop defaults
The Theme component can now override default prop values for all descendant components. Pass a props object where keys are component names and values are their prop overrides:
<template>
<UTheme
:props="{
tooltip: { delayDuration: 0, arrow: true },
button: { color: 'neutral', variant: 'subtle', size: 'lg' },
input: { size: 'lg' }
}"
>
<UTooltip text="Tooltip">
<UButton label="Save" />
</UTooltip>
<UInput placeholder="Search..." />
</UTheme>
</template>Explicit props on a component always take priority. Theme components can be nested (innermost wins) and propagate through the entire tree via provide / inject.
🔍 ContentSearch async search
The ContentSearch component now supports FTS5 full-text search via the new search prop and the useSearchCollection composable (nuxt/content#3787, released in @nuxt/content v3.14.0). Instead of loading all content upfront with files and filtering client-side with Fuse.js, you can now run async queries with highlighted snippets:
<script setup lang="ts">
const { search, status, init } = useSearchCollection('content', {
immediate: false,
ignoredTags: ['style']
})
const { open } = useContentSearch()
watch(open, (value) => {
if (value && status.value === 'idle') {
init()
}
})
</script>
<template>
<UContentSearch :search="search" :search-status="status" />
</template>You can check out the new search on https://ui.nuxt.com or https://nuxt.com.
🚨 Breaking Changes
- InputMenu: rename
autocompleteprop tomodeto free up HTML attribute (#6474)
The boolean autocomplete prop introduced in v4.6.0 collided with the standard HTML autocomplete attribute used for browser autofill (address-line1, one-time-code, email, etc.). It has been renamed to mode which accepts 'combobox' | 'autocomplete' (defaults to combobox). The HTML autocomplete attribute now falls through to the inner input like other form components.
- <UInputMenu autocomplete :items="items" />
+ <UInputMenu mode="autocomplete" :items="items" />🚀 Features
- Avatar/AvatarGroup: add
colorprop (#6405) (6f2396f) - Breadcrumb: add
colorprop (#6406) (955dac1) - ChatMessage: add
bodyslot and improve actions alignment (#6460) (48685b6) - ChatMessage: add
colorprop andheaderslot (#6407) (c6ce8ca) - ChatPrompt: add
submitOnEnterprop to control Enter behavior (b597f90) - Checkbox/RadioGroup/Switch: add
highlightprop for error ring styling (a0deee4) - CommandPalette: search and highlight description field (524c34d)
- ContentSearch/DashboardSearch: enable Fuse.js token search by default (ba08220)
- ContentSearch: add async search support via
useSearchCollection(#6432) (a1bef8b) - DashboardGroup: add
storageOptionsprop (8f0101b) - Error: add
iconprop andleadingslot (e6ea707) - Separator: add
positionprop (#6415) (844660a) - Theme: override component prop defaults (#6031) (71c008e)
🐛 Bug Fixes
- ChatMessage: add
wrap-break-wordto content slot (#6476) (eb468e6) - CommandPalette: only split tokens in highlight when
useTokenSearchis enabled (898fbce) - CommandPalette: preserve relative order of ignoreFilter groups (e4c1787)
- CommandPalette: re-highlight first item after debounced results render (efd7b8e)
- CommandPalette: update default fuse keys in docs and search components (0d9cc0d)
- components: apply
theme.prefixto hardcoded utility classes (f51b1e8) - components: constrain popper content to available viewport height (007b136)
- ContentSearch: preserve intermediate ancestors in breadcrumb prefix (#6466) (f639b19)
- ContentToc: apply
ui.triggerprop to trigger elements (252b906) - defineShortcuts: use
e.codefor alt shortcuts to handle macOS key remapping (231f156) - FileUpload: pass
disabledattribute to button variant (2890c83) - Form: improve errors type (#6208) (c1090ab)
- InputMenu/Select/SelectMenu: respect
trailing: falseover defaulttrailingIcon(#6457) (65b47ce) - InputMenu: rename
autocompleteprop tomodeto free up HTML attribute (#6474) (2799fa6) - module: don't require
@nuxtjs/mdcwhen usingcontentoption (89f7778) - module: pass computed ref directly to useHead innerHTML (00b7476)
- module: ship stripped
#build/ui.cssfallback for tooling (083c2a9) - ProseKbd: add default slot and make
valueoptional (f317c7f) - Textarea: autoresize on mount with pre-filled value (e96a0b6)
- useComponentProps: treat array-typed theme values as
ClassValueleaves (cac3860)
💚 Contributors
Full Changelog: v4.7.1...v4.8.0