v3.1.0
✨ Highlights
🎨 Improved Utility Classes
We've enhanced the utility class system to make it more intuitive and easier to use. While CSS variables provided flexibility, writing classes like text-(--ui-text-muted) proved cumbersome. We've introduced three major improvements:
- Default Color Shades (#3916): New utility classes for default color shades that automatically map to our design system variables. These shades automatically adapt to your color scheme and can be configured for both light and dark modes: https://ui.nuxt.com/getting-started/theme#colors
- <div class="text-(--ui-primary)">
+ <div class="text-primary">
- <div class="bg-(--ui-error)">
+ <div class="bg-error">- Neutral Color Utilities (#3629): New utility classes for text, background, border, ring, divide and outline colors that map to our design system variables. These utilities work with opacity modifiers and automatically adapt to your color mode: https://ui.nuxt.com/getting-started/theme#neutral
- <div class="text-(--ui-text-muted)">
+ <div class="text-muted">
- <div class="border-(--ui-border)">
+ <div class="border-default">
- <div class="bg-(--ui-bg-elevated)/50">
+ <div class="bg-elevated/50">- Dynamic Border Radius Utilities (#3906): Override default Tailwind CSS
rounded-*utilities to use our--ui-radiusCSS variable, making it easier to maintain consistent border radius across your application: https://ui.nuxt.com/getting-started/theme#radius
- <div class="rounded-(--ui-radius)">
+ <div class="rounded-sm">
- <div class="rounded-[calc(var(--ui-radius)*1.5)]">
+ <div class="rounded-md">
- <div class="rounded-[calc(var(--ui-radius)*2)]">
+ <div class="rounded-lg">These changes are fully backward compatible - existing CSS variable-based classes will continue to work while providing a more ergonomic alternative for new code.
🧩 New Components and Features
- CheckboxGroup (#3862): A new component for managing groups of checkboxes with built-in form integration and validation: https://ui.nuxt.com/components/checkbox-group
<script setup lang="ts">
import type { CheckboxGroupItem, CheckboxGroupValue } from '@nuxt/ui'
const items = ref<CheckboxGroupItem[]>(['System', 'Light', 'Dark'])
const value = ref<CheckboxGroupValue[]>(['System'])
</script>
<template>
<UCheckboxGroup v-model="value" :items="items" />
</template>- RadioGroup (#3178): Enhanced with new
cardandtablevariants for more flexible layouts: https://ui.nuxt.com/components/radio-group#variant
<script setup lang="ts">
import type { RadioGroupItem, RadioGroupValue } from '@nuxt/ui'
const items = ref<RadioGroupItem[]>(['System', 'Light', 'Dark'])
const value = ref<RadioGroupValue>('System')
</script>
<template>
<URadioGroup v-model="value" variant="table" :items="items" />
</template>🌉 Inertia.js Integration
The Vue version now includes built-in support for Inertia.js. Enable it with the inertia: true option in your vite.config.ts:
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import ui from '@nuxt/ui/vite'
export default defineConfig({
plugins: [
vue(),
ui({
inertia: true
})
]
})This automatically replaces RouterLink with InertiaLink in all components, providing seamless integration with your Inertia.js applications: https://ui.nuxt.com/getting-started/installation/vue#inertia
⚡ Module Builder Update
The module has been updated to use nuxt/[email protected], bringing improved build performance and better TypeScript support.
Following this change, we've refactored how component types are handled which brings full HMR support with app.config.ts changes, this was only working when reloading the page previously.
🚨 Breaking Changes
This PR changes .open() to return an overlay instance with a result promise property instead of returning the promise directly, providing more flexibility:
<script setup lang="ts>
const modal = useOverlay()
- const result = await modal.open({ count: count.value })
+ const instance = modal.open({ count: count.value })
+ const result = await instance.result
</script>🚀 Features
- App: add global
portalprop (#3688) (29fa462) - Carousel: add
selectevent (#3678) (22edfd7) - CheckboxGroup: new component (#3862) (9c3d53a)
- components: add new
content-topandcontent-bottomslots (#3886) (1a46394) - Form: add
attachprop to opt-out of nested form attachement (#3939) (1a0d7a3) - Form: export loading state (#3861) (fdee252)
- InputMenu/SelectMenu: handle
resetSearchTermOnSelect(cea881a), closes #3782 - InputNumber: add support for
stepSnapping&disableWheelChangeprops (#3731) (f5e6284) - Modal/Popover/Slideover: add
close:preventevent (#3958) (f486423) - module: define default color shades (#3916) (7ac7aa9)
- module: define neutral utilities (#3629) (d49e0da)
- module: dynamic
rounded-*utilities (#3906) (f9737c8) - OverlayProvider: return an overlay instance from
.open()(#3829) (f3098df) - PinInput: add
autofocus/autofocus-delayprops (0456670), closes #3717 - RadioGroup: add
cardandtablevariants (#3178) (4d138ad) - Select: handle
onSelectfield in items (8640831) - Table: conditionally apply classes to
trandtd(#3866) (80dfa88) - Tabs: add
list-leadingandlist-trailingslots (#3837) (3447a06) - Textarea: add
autoresize-delayprop (06414d3), closes #3730 - Textarea: add
icon,loading, etc. props to match Input (cb193f1) - Textarea: add
resize-noneclass withautoresizeprop (ffafd81) - unplugin: routing support for inertia (#3845) (d059efc)
🐛 Bug Fixes
- Accordion: use
divinstead ofh3for header tag (75e4792), closes #3963 - Alert/Toast: display actions when using slots (5086363), closes #3950
- Carousel: move arrows inside container on mobile (d339dcb), closes #3813
- CommandPalette: consistent alignement with other components (d25265c)
- CommandPalette: increase input font size to avoid zoom (d227a10)
- CommandPalette: prevent hover background on disabled items (ba534f1)
- components: refactor types after
@nuxt/module-builderupgrade (#3855) (39c861a) - components: respect
transform-originin popper content (#3919) (01d8dc7) - ContextMenu/DropdownMenu: handle RTL mode (#3744) (1ae5cc0)
- ContextMenuContent/DropdownMenuContent: remove unwanted
any(#3741) (97274f1) - Form: input and output type inference (#3938) (f429498)
- Form: loses focus on submit (#3796) (8e78eb1)
- InputMenu/SelectMenu: correctly call
onSelectevents (#3735) (f25fed5) - InputMenu/SelectMenu: prevent
disableditems to be selected (8435a0f), closes #3474 - InputMenu/SelectMenu: remove
valueKeystring case (9ca213b), closes #3949 #3331 - InputMenu/SelectMenu: support arbitrary
value(#3779) (52a97e2) - InputMenu: emit
changeon multiple item removal (9d2fed1), closes #3756 - Link: proxy
downloadproperty (#3879) (47cdc2e) - NavigationMenu: add
sm:w-autocontent slot (abe0859), closes #3788 - Skeleton: improve accessibility (#3613) (3484832)
- Stepper: ui prop override on
iconandcontentslots (1d45980), closes #3785 - Table: improve
datareactivity (#3967) (6e27304) - Table: pass header
colspantoth(#3926) (122e8ac) - Tree: simplify reusable template types (#3836) (3deed4c)
- types: allow color identifiers with dashes (#3896) (e5a1e26)
- types: handle
ClassValueinuiprop (eea1415), closes #3860 - types: improve dynamic slots (#3857) (8dd9d08)
- usePortal: adjust portal target resolution logic (#3954) (db11db6)
- vite: vitest skipping nuxt imports transformations (#3925) (c31bffa)
🌐 Locales
- locale: add Bulgarian language (#3783) (a0c9731)
- locale: add Kazakh language (#3875) (43153c4)
- locale: add Tajik language (#3850) (f42a79b)
- locale: add Uyghur language (#3878) (b7fc69b)
👋 New Contributors
- @robinsimonklein made their first contribution in #3731
- @Gui-Fernandes21 made their first contribution in #3781
- @vachmara made their first contribution in #3790
- @howbizarre made their first contribution in #3783
- @SukkaW made their first contribution in #3575
- @avenikolay made their first contribution in #3850
- @altynbek07 made their first contribution in #3875
- @ElshadBeg made their first contribution in #3878
- @dannote made their first contribution in #3879
- @50rayn made their first contribution in #3917
- @hanneskuettner made their first contribution in #3919
- @LoTwT made their first contribution in #3903
- @ExXTreMe315 made their first contribution in #3918
- @fm96-dev made their first contribution in #3925
- @menthol made their first contribution in #3688
- @EvanSchleret made their first contribution in #3793
- @dapingtai made their first contribution in #3740
- @gigor made their first contribution in #3926
- @itspolly made their first contribution in #3678
- @TribeWeb made their first contribution in #3862
- @andr35 made their first contribution in #3866
- @zguig52 made their first contribution in #3967
Full Changelog: v3.0.2...v3.1.0