Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
f00ac8f
feat(components)!: render the menu filter as an inset field
benjamincanac Nov 12, 2026
5fad56c
Merge remote-tracking branch 'origin/v5' into feat/filter-field
benjamincanac Nov 12, 2026
1478a08
feat(components): use the soft variant and the item highlight size fo…
benjamincanac Nov 12, 2026
76dab36
feat(components): drop the focus outline on the filter
benjamincanac Nov 12, 2026
c6848f2
Merge remote-tracking branch 'origin/v5' into feat/filter-field
benjamincanac Nov 13, 2026
a38d357
feat(CommandPalette): keep the ghost close button inside the filter
benjamincanac Nov 16, 2026
f730846
feat(components): size the filter like the items and drop the larger …
benjamincanac Nov 16, 2026
8b61d96
fix(CommandPalette): raise the close hover through the accent soft va…
benjamincanac Nov 16, 2026
99e57a8
fix(CommandPalette): restore the close hover class
benjamincanac Nov 16, 2026
7bb0727
fix(CommandPalette): inset the close button 4px in the filter
benjamincanac Nov 16, 2026
c36e6a2
fix(CommandPalette): keep the button radius on the close
benjamincanac Nov 16, 2026
a97dca7
fix(CommandPalette): give the close a smaller corner than the filter
benjamincanac Nov 16, 2026
d246cfe
feat(components)!: style the buttons inside fields as ghost buttons
benjamincanac Nov 16, 2026
b94b9e0
fix(CommandPalette): take the close inset from the spacing scale
benjamincanac Nov 16, 2026
e541174
Merge remote-tracking branch 'origin/feat/filter-field' into feat/fie…
benjamincanac Nov 16, 2026
2e3710f
feat(components): turn the field chevrons over while the menu is open
benjamincanac Nov 16, 2026
aaa70e8
refactor(CommandPalette): leave the close button to the field buttons…
benjamincanac Nov 17, 2026
c69c84f
Merge remote-tracking branch 'origin/feat/filter-field' into feat/fie…
benjamincanac Nov 17, 2026
1f9be0c
fix(CommandPalette): line the close icon up with the search icon
benjamincanac Nov 17, 2026
5e25cbe
docs(migration): mention the close inset of the filter
benjamincanac Nov 17, 2026
873f744
feat(components): size the buttons of a field from its leading and tr…
benjamincanac Nov 17, 2026
5bb295a
Merge remote-tracking branch 'origin/v5' into feat/field-buttons
benjamincanac Nov 17, 2026
ded4783
fix(components): line the menu items and the field buttons up with th…
benjamincanac Nov 17, 2026
d46b405
Merge remote-tracking branch 'origin/v5' into feat/field-buttons
benjamincanac Nov 17, 2026
e15c4c9
docs(migration): restore the v5 sections and scope the field button s…
benjamincanac Nov 17, 2026
f3932ff
docs(migration): keep the size on link buttons in field slots
benjamincanac Nov 17, 2026
6769b1b
fix(components): keep the field buttons square with their icons aligned
benjamincanac Nov 17, 2026
700814f
feat(InputNumber): stack the vertical buttons inside the field
benjamincanac Nov 17, 2026
3e778eb
fix(components): leave labelled buttons in field slots their own padding
benjamincanac Nov 17, 2026
67cdbef
docs(migration): pass the text of a field button through label
benjamincanac Nov 17, 2026
5adacdc
feat(components): give the Select and SelectMenu chevron the field bu…
benjamincanac Nov 18, 2026
ca82bbf
fix(Select): scope the chevron box hover to neutral
benjamincanac Nov 18, 2026
4256c96
refactor(Select): keep the chevron a plain icon, only InputMenu boxes it
benjamincanac Nov 18, 2026
59677ce
fix(components): keep field buttons 4px from the edge when the side p…
benjamincanac Nov 18, 2026
010189a
fix(components): keep every field button the same size with a 4px min…
benjamincanac Nov 18, 2026
15342da
fix(components): inset menu filters 2px so their buttons line up with…
benjamincanac Nov 18, 2026
62df969
fix(InputDate): keep field buttons at least 4px from the side
benjamincanac Nov 18, 2026
198d2d8
fix(CommandPalette): keep the 4px filter inset and pad the items with…
benjamincanac Nov 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ const modelValue = shallowRef(new CalendarDate(2022, 1, 10))
<UPopover :reference="inputDate?.inputsRef[3]?.$el">
<UButton
color="neutral"
variant="link"
size="sm"
variant="ghost"
icon="i-lucide-calendar"
aria-label="Select a date"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ const modelValue = shallowRef({
<UPopover :reference="inputDate?.inputsRef[0]?.$el">
<UButton
color="neutral"
variant="link"
size="sm"
variant="ghost"
icon="i-lucide-calendar"
aria-label="Select a date range"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ const value = ref('Click to clear')
<template v-if="value?.length" #trailing>
<UButton
color="neutral"
variant="link"
size="sm"
variant="ghost"
icon="i-lucide-circle-x"
aria-label="Clear input"
@click="value = ''"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ const { copy, copied } = useClipboard()
<UTooltip text="Copy to clipboard" :content="{ side: 'right' }">
<UButton
:color="copied ? 'success' : 'neutral'"
variant="link"
size="sm"
variant="ghost"
:icon="copied ? 'i-lucide-copy-check' : 'i-lucide-copy'"
aria-label="Copy to clipboard"
@click="copy(value)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ const text = computed(() => {
<template #trailing>
<UButton
color="neutral"
variant="link"
size="sm"
variant="ghost"
:icon="show ? 'i-lucide-eye-off' : 'i-lucide-eye'"
:aria-label="show ? 'Hide password' : 'Show password'"
:aria-pressed="show"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ const password = ref('')
<template #trailing>
<UButton
color="neutral"
variant="link"
size="sm"
variant="ghost"
:icon="show ? 'i-lucide-eye-off' : 'i-lucide-eye'"
:aria-label="show ? 'Hide password' : 'Show password'"
:aria-pressed="show"
Expand Down
43 changes: 39 additions & 4 deletions docs/content/docs/1.getting-started/3.migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -1164,7 +1164,7 @@ Icons are one step smaller at every size, so an icon no longer outweighs its lab

The avatars of Button, Badge, Tabs, NavigationMenu, the fields and the menu items, and the kbds of the menu items, DashboardSearchButton and ContentSearchButton, follow the line so they don't grow the control. At `xs` and `sm` they take the new 14px Avatar `4xs` and Kbd `xs`, and AvatarGroup and Chip get a `4xs` size to match. Avatar, AvatarGroup and Chip also get a `4xl` size at the other end of the scale, 52px for Avatar. Kbd gets an `xl` size, 28px, so it has the five sizes of the controls. A `'*'` size of `xs` or `xl` in `<UTheme :props>` or `app.config.ui.defaultVariants`, which Kbd used to skip, now reaches a Kbd that has no `size` of its own, ProseKbd included. The Kbds of the menu items keep the size their component gives them. User and Timeline get the `4xs` and `4xl` sizes of the Avatar they render. The chips of the menu items take the same step. The avatar of a Badge is now the size of its icons, 12px at `xs` and `sm`, so a Badge with an avatar is as tall as one without, 14px at `xs` and 16px at `sm` instead of 20px. Badge `sm` is 16px tall instead of 20, with `py` going from `1` to `0.5`, so it fits a link or a tab, and Badge `lg` and `xl` follow the same rule as the scale. Badge `xs` is 14px tall instead of 16, with `py` going from `0.5` to `0.25`, and Tabs render their badge at `xs` for their `xs` and `sm` sizes, so it fits the 14px line. NavigationMenu and InputDate do the same with their own values, and the separator of an InputDate or InputTime range follows the line at `xs` and `sm`, and the icons next to `text-sm` in Accordion, Alert, Banner, Breadcrumb, ContentNavigation, ContentToc, FooterColumns, NavigationMenu, PageLinks, PricingPlan, PricingTable, Separator and Toast go from `size-5` to `size-4`. The avatars of Breadcrumb and Separator follow them and go from `2xs` to `3xs`.

Text that wraps or stacks keeps the line height it had, through a new [`--ui-control-text-<size>--leading`](/docs/getting-started/theme/css-variables#control): the legend of CheckboxGroup and RadioGroup, the labels and descriptions of Checkbox, RadioGroup and Switch, Textarea, FileUpload, the descriptions and group labels of the menus and the tags of InputTags and InputMenu. Textarea, FileUpload, the group labels and the tags take half the difference off `py`, so their heights don't change. A field also adds `--ui-control-text-step` to its line and takes half of it off `py`, so larger text keeps its descenders. The menu items, padded with `py` on every side, get 2px more room at the sides from `md` and 1px at `xs` and `sm`.
Text that wraps or stacks keeps the line height it had, through a new [`--ui-control-text-<size>--leading`](/docs/getting-started/theme/css-variables#control): the legend of CheckboxGroup and RadioGroup, the labels and descriptions of Checkbox, RadioGroup and Switch, Textarea, FileUpload, the descriptions and group labels of the menus and the tags of InputTags and InputMenu. Textarea, FileUpload, the group labels and the tags take half the difference off `py`, so their heights don't change. A field also adds `--ui-control-text-step` to its line and takes half of it off `py`, so larger text keeps its descenders.

::note
If you set `--ui-control-py-<size>` or `--ui-control-text-<size>--line-height` in your CSS, take 4px off the line height and add 2px to `py` on each side at `md` to `xl`, and 2px and 1px at `xs` and `sm`, to keep your heights, and keep the line height equal to `--ui-control-icon-size-<size>` so icon-only buttons stay as tall as the others. An icon, an avatar or a kbd you put in a slot of a control makes it taller when it's larger than the line: size an icon with `size-(--ui-control-icon-size)` and a kbd with `size="xs"` at `xs` and `sm` and `size="sm"` at `md` and `lg`.
Expand Down Expand Up @@ -1340,14 +1340,14 @@ A prop left behind fails silently: Vue passes an unknown prop on as an attribute

### Filter field

The filter input of CommandPalette, DashboardSearch, ContentSearch, SelectMenu, DropdownMenu and Listbox is now a field inside the menu instead of a full-width bar with a border under it. It uses the `soft` variant of Input instead of `none`, without its focus outline since the field keeps the focus while the menu is open, and is as large as an item: it sits 4px from the edges of the menu like the items, and takes their padding through `--ui-control-px` in each `size`, so its icon and text line up with the items and the group labels.
The filter input of CommandPalette, DashboardSearch, ContentSearch, SelectMenu, DropdownMenu and Listbox is now a field inside the menu instead of a full-width bar with a border under it. It uses the `soft` variant of Input instead of `none`, without its focus outline since the field keeps the focus while the menu is open, and is as large as an item: it sits 4px from the edges of the menu like the items, and takes their side padding through `--ui-control-px` in each `size`, so its icon and text line up with the items and the group labels.

```diff
-<div data-slot="select-menu-filter" class="… bg-transparent rounded-none border-b border-default">
+<div data-slot="select-menu-filter" class="… bg-tint hover:bg-soft has-[>:focus]:bg-soft … rounded-md mx-1 mt-1 has-[>:focus-visible]:outline-0 [--ui-control-px:var(--ui-control-py-md)]">
+<div data-slot="select-menu-filter" class="… bg-tint hover:bg-soft has-[>:focus]:bg-soft … rounded-md mx-1 mt-1 has-[>:focus-visible]:outline-0 [--ui-control-px:calc(var(--ui-control-px-md)-(--spacing(1)))]">
```

On CommandPalette, the filter no longer sets the height of its input and is as tall as its items. The divider under it is gone: `root` loses `divide-y divide-default` and `footer` gets `border-t border-default`. The back and close buttons take back the inset of the field with `-ms-1` and `-me-1`, so their icons sit where the search icon does. The filter of DashboardSearch and ContentSearch no longer sets `--ui-control-text-step`, so its text is the size of the items.
On CommandPalette, the filter no longer sets the height of its input and is as tall as its items. The divider under it is gone: `root` loses `divide-y divide-default` and `footer` gets `border-t border-default`. The filter of DashboardSearch and ContentSearch no longer sets `--ui-control-text-step`, so its text is the size of the items.

```diff
-<div data-slot="command-palette" class="flex flex-col min-h-0 min-w-0 divide-y divide-default">
Expand All @@ -1362,6 +1362,41 @@ A class you set on `filter` to remove the border, like `border-b-0`, is no longe
<USelectMenu :filter="{ variant: 'none' }" :ui="{ filter: 'm-0 rounded-none border-b border-default' }" />
```

### Menu item padding

The items and the group labels of ContextMenu, DropdownMenu, EditorSuggestionMenu, InputMenu, Listbox, Select and SelectMenu take their side padding from `--ui-control-px` minus the 4px of their group, instead of `--ui-control-py`. Their icons and text now sit where the ones of the trigger do, at every size.

```diff
-<div data-slot="select-menu-item" class="… p-(--ui-control-py) …">
+<div data-slot="select-menu-item" class="… px-[calc(var(--ui-control-px)-(--spacing(1)))] py-(--ui-control-py) …">
```

### Buttons inside fields

The buttons a component puts inside a field now share one look: the `ghost` variant instead of `link`, square and 4px from the top and the bottom of the box, with a hover a step above the fill of the box. That covers the clear button of SelectMenu, the increment and decrement buttons of InputNumber and the back and close buttons of CommandPalette. With `orientation: 'vertical'`, the InputNumber buttons are stacked in one column 4px inside the box, each half of it with an icon as tall, no longer two scaled down `link` buttons. In InputMenu, the trigger that holds the clear or the chevron takes that box and hover instead, and its clear button stays `link` inside it.

```diff
-<span data-slot="select-menu-trailingClear" class="… text-accent-muted hover:text-accent-default … p-0">
+<span data-slot="select-menu-trailingClear" class="… -my-[calc(var(--ui-control-py)-(--spacing(1)))] -me-[calc(var(--ui-control-py)-(--spacing(1)))] p-[calc(var(--ui-control-py)-(--spacing(1)))] rounded-sm hover:bg-accent-strong active:bg-accent-strong">
-<button data-slot="input-menu-trailing" class="group flex items-center pe-(--ui-control-px) …">
+<button data-slot="input-menu-trailing" class="group flex items-center me-[calc(var(--ui-control-px)-var(--ui-control-py)+(--spacing(1)))] [--ui-accent:var(--ui-neutral)] p-[calc(var(--ui-control-py)-(--spacing(1)))] rounded-sm enabled:hover:bg-accent-strong enabled:active:bg-accent-strong …">
```

A button in the `leading` or `trailing` slot of Input, InputTags, InputNumber, InputDate, InputTime and Textarea is now square whatever its `size`, 4px from the top and the bottom of the box, with its icon where an icon of the field would be and never closer than 4px to the side: the slot gives it the top padding of the field less 4px on every side, the icon size of the field and a `rounded-sm` corner, and sets its own side padding so the icon lands on the field's. A button with a `label` keeps its own padding and `size`. Pass its text through `label` and not the default slot, which CSS can't tell apart from an icon-only button. On an icon-only button, the `size` only sets the text and can go. To match the built-in buttons, use the `ghost` variant. Each slot has to be checked in its context, a find and replace can't apply this:

```diff
<UInput>
<template #trailing>
- <UButton variant="link" size="sm" icon="i-lucide-eye" />
+ <UButton variant="ghost" icon="i-lucide-eye" />
</template>
</UInput>
```

The slot styles its direct `<button>` child only: a Button with `to` or `href` renders an `<a>` and keeps the padding and the icon of its own `size`, so keep its size. A padding or a corner you set on a `<button>` with `class` loses to the slot. Set it through the `ui` prop of the field, `:ui="{ trailing: '[&>button]:p-1' }"`.

The hover is set on the slot of each button, so it also replaces the hover of a variant you pass through `clear` on SelectMenu, `increment`, `decrement`, `back` or `close`. Reset it through `ui` when you do. On InputMenu the hover is on the trigger, so a variant passed through `clear` keeps its own hover on top of it.

### Stacked toasts

Toasts are now stacked by default: the `expand` prop of the Toaster defaults to `false`, and hovering or focusing the stack expands it. Set it back to `true` on the App to keep every toast visible:
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/components/CommandPalette.vue
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export interface CommandPaletteProps<G extends CommandPaletteGroup<T> = CommandP
closeIcon?: IconProps['name']
/**
* Display a button to navigate back in history.
* `{ size: 'md', color: 'neutral', variant: 'link' }`{lang="ts-type"}
* `{ size: 'md', color: 'neutral', variant: 'ghost' }`{lang="ts-type"}
* @defaultValue true
*/
back?: boolean | Omit<ButtonProps, LinkPropsKeys>
Expand Down Expand Up @@ -605,7 +605,7 @@ function onSelect(e: Event, item: T) {
:size="props.size"
:icon="props.backIcon || appConfig.ui.icons.arrowLeft"
color="neutral"
variant="link"
variant="ghost"
:aria-label="t('commandPalette.back')"
v-bind="(typeof props.back === 'object' ? props.back : {})"
data-slot="command-palette-back"
Expand Down
8 changes: 4 additions & 4 deletions src/runtime/components/InputNumber.vue
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export interface InputNumberProps<T extends InputNumberValue = InputNumberValue,
orientation?: InputNumber['variants']['orientation']
/**
* Configure the increment button. The `color` and `size` are inherited.
* @defaultValue { variant: 'link' }
* @defaultValue { variant: 'ghost' }
*/
increment?: boolean | Omit<ButtonProps, LinkPropsKeys>
/**
Expand All @@ -51,7 +51,7 @@ export interface InputNumberProps<T extends InputNumberValue = InputNumberValue,
incrementDisabled?: boolean
/**
* Configure the decrement button. The `color` and `size` are inherited.
* @defaultValue { variant: 'link' }
* @defaultValue { variant: 'ghost' }
*/
decrement?: boolean | Omit<ButtonProps, LinkPropsKeys>
/**
Expand Down Expand Up @@ -244,7 +244,7 @@ defineExpose({
:icon="incrementIcon"
:color="color"
:size="size"
variant="link"
variant="ghost"
:aria-label="t('inputNumber.increment')"
v-bind="typeof props.increment === 'object' ? props.increment : undefined"
/>
Expand All @@ -259,7 +259,7 @@ defineExpose({
:icon="decrementIcon"
:color="color"
:size="size"
variant="link"
variant="ghost"
:aria-label="t('inputNumber.decrement')"
v-bind="typeof props.decrement === 'object' ? props.decrement : undefined"
/>
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/components/SelectMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -743,7 +743,7 @@ defineExpose({
as="span"
:icon="props.clearIcon || appConfig.ui.icons.close"
:size="size"
variant="link"
variant="ghost"
color="neutral"
tabindex="-1"
v-bind="clearProps"
Expand Down
11 changes: 6 additions & 5 deletions src/runtime/theme/command-palette.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ export default defineTheme({
slots: {
root: 'flex flex-col min-h-0 min-w-0',
// A field as large as an item, inset like the items: its padding is theirs, so its
// icon and text line up with them
// icon and text line up with them, and with the icon of a back or a close button.
// With no trigger to line up with, the items keep the padding of their size
// It holds the focus as long as the menu is open, so it shows no focus outline
filter: 'mx-1 mt-1 has-[>:focus-visible]:outline-0',
// The back and the close take back the inset of the field, so their icon sits where
// the search icon does
back: '-ms-1',
close: '-me-1',
// The field sizes the back and the close like any button in its leading or trailing,
// their hover is a step above the fill of the focused field
back: 'hover:bg-accent-strong active:bg-accent-strong',
close: 'hover:bg-accent-strong active:bg-accent-strong',
content: 'relative overflow-hidden flex flex-col',
footer: 'p-1 border-t border-default',
viewport: 'relative scroll-py-1 overflow-y-auto flex-1 focus:outline-none',
Expand Down
Loading
Loading