Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 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
b94b9e0
fix(CommandPalette): take the close inset from the spacing scale
benjamincanac Nov 16, 2026
aaa70e8
refactor(CommandPalette): leave the close button to the field buttons…
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
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 @@ -43,7 +43,6 @@ const label = ref([])
multiple
:filter="{ placeholder: 'Search labels...' }"
:groups="[{ id: 'labels', items }]"
:ui="{ filter: '[&>input]:h-8 [&>input]:text-sm' }"
/>
</template>
</UPopover>
Expand Down
24 changes: 24 additions & 0 deletions docs/content/docs/1.getting-started/3.migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -1330,6 +1330,30 @@ The theme slot of that input follows the prop on all six components: `input` is
A prop left behind fails silently: Vue passes an unknown prop on as an attribute, so the filter input shows again where you hid it, and a `placeholder` or an `icon` set on a CommandPalette, a DashboardSearch or a ContentSearch is ignored. `search-input` can be renamed with a find and replace. The rest can't: `placeholder`, `icon`, `trailing-icon` and `autofocus` have to be merged into the `filter` object, and they keep their meaning on other components. The `input` prop and slot only change on the six components above: AuthForm keeps its `input` slot, and `input` is also the app config key of the Input component. Props passed through `v-bind` or `<UTheme :props>` have to be found by hand. TypeScript reports a leftover `input` slot in `app.config.ts` and on the `ui` prop, not in a `ui` object built at runtime.
::

### 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.

```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)]">
```

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.

```diff
-<div data-slot="command-palette" class="flex flex-col min-h-0 min-w-0 divide-y divide-default">
- <div data-slot="command-palette-filter" class="… rounded-none [&>input]:h-12">
+<div data-slot="command-palette" class="flex flex-col min-h-0 min-w-0">
+ <div data-slot="command-palette-filter" class="… rounded-md mx-1 mt-1 …">
```

A class you set on `filter` to remove the border, like `border-b-0`, is no longer needed. To get the bar back, pass `variant: 'none'` in the `filter` prop and reset the slot:

```vue
<USelectMenu :filter="{ variant: 'none' }" :ui="{ filter: 'm-0 rounded-none border-b border-default' }" />
```

### 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 @@ -116,7 +116,7 @@ export interface CommandPaletteProps<G extends CommandPaletteGroup<T> = CommandP
/**
* Whether to display a filter input or not.
* Can be an object to pass additional props to the input, set `icon: false` to hide its icon.
* `{ placeholder: t('commandPalette.filterPlaceholder'), icon: appConfig.ui.icons.search, autofocus: true, variant: 'none' }`{lang="ts-type"}
* `{ placeholder: t('commandPalette.filterPlaceholder'), icon: appConfig.ui.icons.search, autofocus: true, variant: 'soft' }`{lang="ts-type"}
* @defaultValue true
*/
filter?: boolean | (Omit<InputProps, 'modelValue' | 'defaultValue' | 'icon'> & { icon?: IconProps['name'] | false })
Expand Down Expand Up @@ -312,7 +312,7 @@ const history = ref<(CommandPaletteGroup & { placeholder?: string })[]>([])
const filterProps = computed(() => {
const filter = typeof props.filter === 'object' ? props.filter : {}

return defu({ ...filter, icon: filter.icon === false ? undefined : (filter.icon ?? appConfig.ui.icons.search) }, { autofocus: true, variant: 'none' }) as Omit<InputProps, 'modelValue' | 'defaultValue'>
return defu({ ...filter, icon: filter.icon === false ? undefined : (filter.icon ?? appConfig.ui.icons.search) }, { autofocus: true, variant: 'soft' }) as Omit<InputProps, 'modelValue' | 'defaultValue'>
})

const placeholder = computed(() => history.value[history.value.length - 1]?.placeholder || filterProps.value.placeholder || t('commandPalette.filterPlaceholder'))
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/components/DashboardSearch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export interface DashboardSearchProps<T extends CommandPaletteItem = CommandPale
/**
* Whether to display a filter input or not.
* Can be an object to pass additional props to the input, set `icon: false` to hide its icon.
* `{ placeholder: t('commandPalette.filterPlaceholder'), icon: appConfig.ui.icons.search, autofocus: true, variant: 'none' }`{lang="ts-type"}
* `{ placeholder: t('commandPalette.filterPlaceholder'), icon: appConfig.ui.icons.search, autofocus: true, variant: 'soft' }`{lang="ts-type"}
* @defaultValue true
*/
filter?: CommandPaletteProps['filter']
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/components/DropdownMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ export interface DropdownMenuProps<T extends ArrayOrNested<DropdownMenuItem> = A
/**
* Whether to display a filter input or not.
* Can be an object to pass additional props to the input.
* `{ placeholder: t('dropdownMenu.filterPlaceholder'), autofocus: true, variant: 'none' }`{lang="ts-type"}
* `{ placeholder: t('dropdownMenu.filterPlaceholder'), autofocus: true, variant: 'soft' }`{lang="ts-type"}
* @defaultValue false
*/
filter?: boolean | Omit<InputProps, 'modelValue' | 'defaultValue'>
Expand Down Expand Up @@ -230,7 +230,7 @@ watch(() => props.open, (open) => {
})

const childrenIcon = computed(() => dir.value === 'rtl' ? appConfig.ui.icons.chevronLeft : appConfig.ui.icons.chevronRight)
const getFilterProps = (filter: DropdownMenuItem['filter']) => defu(filter, { placeholder: t('dropdownMenu.filterPlaceholder'), variant: 'none' }) as Omit<InputProps, 'modelValue' | 'defaultValue'>
const getFilterProps = (filter: DropdownMenuItem['filter']) => defu(filter, { placeholder: t('dropdownMenu.filterPlaceholder'), variant: 'soft' }) as Omit<InputProps, 'modelValue' | 'defaultValue'>
const isStructuralItem = (item: DropdownMenuItem) => !!item.type && ['label', 'separator'].includes(item.type)

function getFilteredGroups({ items, path, filter, filterFields, ignoreFilter }: { items?: ArrayOrNested<DropdownMenuItem>, path: string, filter?: DropdownMenuItem['filter'], filterFields?: string[], ignoreFilter?: boolean }) {
Expand Down
4 changes: 2 additions & 2 deletions src/runtime/components/Listbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export interface ListboxProps<T extends ArrayOrNested<ListboxItem> = ArrayOrNest
/**
* Whether to display a filter input or not.
* Can be an object to pass additional props to the input.
* `{ placeholder: t('listbox.filterPlaceholder'), variant: 'none' }`{lang="ts-type"}
* `{ placeholder: t('listbox.filterPlaceholder'), variant: 'soft' }`{lang="ts-type"}
* @defaultValue false
*/
filter?: boolean | Omit<InputProps, 'modelValue' | 'defaultValue'>
Expand Down Expand Up @@ -210,7 +210,7 @@ const virtualizerProps = toRef(() => {
estimateSize: getEstimateSize(filteredItems.value, size.value ?? 'md', props.descriptionKey as string, !!slots['item-description'])
})
})
const filterProps = toRef(() => defu(typeof props.filter === 'object' ? props.filter : {}, { placeholder: t('listbox.filterPlaceholder'), variant: 'none' }) as Omit<InputProps, 'modelValue' | 'defaultValue'>)
const filterProps = toRef(() => defu(typeof props.filter === 'object' ? props.filter : {}, { placeholder: t('listbox.filterPlaceholder'), variant: 'soft' }) as Omit<InputProps, 'modelValue' | 'defaultValue'>)

const { emitFormChange, emitFormInput, name, size: formFieldSize, color: formFieldColor, id, highlight: formFieldHighlight, disabled: formFieldDisabled, labelId, ariaAttrs } = useFormField<InputProps>(_props, { bind: false })

Expand Down
4 changes: 2 additions & 2 deletions src/runtime/components/SelectMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export interface SelectMenuProps<T extends ArrayOrNested<SelectMenuItem> = Array
/**
* Whether to display a filter input or not.
* Can be an object to pass additional props to the input.
* `{ placeholder: t('selectMenu.filterPlaceholder'), autofocus: true, variant: 'none' }`{lang="ts-type"}
* `{ placeholder: t('selectMenu.filterPlaceholder'), autofocus: true, variant: 'soft' }`{lang="ts-type"}
* Set `autofocus: false` to prevent the filter input from being focused when the menu opens (e.g. to avoid opening the virtual keyboard on touch devices).
* @defaultValue true
*/
Expand Down Expand Up @@ -290,7 +290,7 @@ const virtualizerProps = toRef(() => {
estimateSize: getEstimateSize(filteredItems.value, size.value ?? 'md', props.descriptionKey as string, !!slots['item-description'])
})
})
const filterProps = toRef(() => defu(props.filter, { placeholder: t('selectMenu.filterPlaceholder'), variant: 'none' }) as Omit<InputProps, 'modelValue' | 'defaultValue'>)
const filterProps = toRef(() => defu(props.filter, { placeholder: t('selectMenu.filterPlaceholder'), variant: 'soft' }) as Omit<InputProps, 'modelValue' | 'defaultValue'>)

const { emitFormBlur, emitFormFocus, emitFormInput, emitFormChange, size: formFieldSize, color: formFieldColor, id, name, highlight: formFieldHighlight, disabled: formFieldDisabled, ariaAttrs } = useFormField<InputProps>(_props)

Expand Down
2 changes: 1 addition & 1 deletion src/runtime/components/content/ContentSearch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export interface ContentSearchProps<T extends ContentSearchLink = ContentSearchL
/**
* Whether to display a filter input or not.
* Can be an object to pass additional props to the input, set `icon: false` to hide its icon.
* `{ placeholder: t('commandPalette.filterPlaceholder'), icon: appConfig.ui.icons.search, autofocus: true, variant: 'none' }`{lang="ts-type"}
* `{ placeholder: t('commandPalette.filterPlaceholder'), icon: appConfig.ui.icons.search, autofocus: true, variant: 'soft' }`{lang="ts-type"}
* @defaultValue true
*/
filter?: CommandPaletteProps['filter']
Expand Down
28 changes: 15 additions & 13 deletions src/runtime/theme/command-palette.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@ import { defineTheme } from '../utils/theme'

export default defineTheme({
slots: {
root: 'flex flex-col min-h-0 min-w-0 divide-y divide-default',
// The input sits flush in the palette, above a full-width divider
filter: 'rounded-none',
// The filter is taller than the button: the close keeps the same inset on
// every side, the back keeps its padding so its icon lines up with the items
close: 'me-1',
back: '',
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
// 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',
content: 'relative overflow-hidden flex flex-col',
footer: 'p-1',
footer: 'p-1 border-t border-default',
viewport: 'relative scroll-py-1 overflow-y-auto flex-1 focus:outline-none',
group: 'p-1 isolate',
empty: 'text-center text-muted',
Expand Down Expand Up @@ -42,7 +44,7 @@ export default defineTheme({
size: {
xs: {
content: '[--ui-control-py:var(--ui-control-py-xs)] [--ui-control-gap:var(--ui-control-gap-xs)] [--ui-control-icon-size:var(--ui-control-icon-size-xs)]',
filter: '[&>input]:h-10',
filter: '[--ui-control-px:var(--ui-control-py-xs)]',
empty: 'py-3 text-xs',
label: 'px-(--ui-control-py) py-[calc(var(--ui-control-py)-(var(--ui-control-text-xs--leading)-var(--ui-control-text-xs--line-height))/2)] text-[calc(var(--ui-control-text-xs)-0.125rem)]/[calc(var(--ui-control-text-xs--leading)-0.25rem)] gap-(--ui-control-gap)',
item: 'p-(--ui-control-py) text-(length:--ui-control-text-xs)/(--ui-control-text-xs--line-height) gap-(--ui-control-gap)',
Expand All @@ -56,7 +58,7 @@ export default defineTheme({
},
sm: {
content: '[--ui-control-py:var(--ui-control-py-sm)] [--ui-control-gap:var(--ui-control-gap-sm)] [--ui-control-icon-size:var(--ui-control-icon-size-sm)]',
filter: '[&>input]:h-11',
filter: '[--ui-control-px:var(--ui-control-py-sm)]',
empty: 'py-4 text-xs',
label: 'px-(--ui-control-py) py-[calc(var(--ui-control-py)-(var(--ui-control-text-sm--leading)-var(--ui-control-text-sm--line-height))/2)] text-[calc(var(--ui-control-text-sm)-0.125rem)]/[calc(var(--ui-control-text-sm--leading)-0.25rem)] gap-(--ui-control-gap)',
item: 'p-(--ui-control-py) text-(length:--ui-control-text-sm)/(--ui-control-text-sm--line-height) gap-(--ui-control-gap)',
Expand All @@ -70,7 +72,7 @@ export default defineTheme({
},
md: {
content: '[--ui-control-py:var(--ui-control-py-md)] [--ui-control-gap:var(--ui-control-gap-md)] [--ui-control-icon-size:var(--ui-control-icon-size-md)]',
filter: '[&>input]:h-12',
filter: '[--ui-control-px:var(--ui-control-py-md)]',
empty: 'py-6 text-sm',
label: 'px-(--ui-control-py) py-[calc(var(--ui-control-py)-(var(--ui-control-text-md--leading)-var(--ui-control-text-md--line-height))/2)] text-[calc(var(--ui-control-text-md)-0.125rem)]/[calc(var(--ui-control-text-md--leading)-0.25rem)] gap-(--ui-control-gap)',
item: 'p-(--ui-control-py) text-(length:--ui-control-text-md)/(--ui-control-text-md--line-height) gap-(--ui-control-gap)',
Expand All @@ -84,7 +86,7 @@ export default defineTheme({
},
lg: {
content: '[--ui-control-py:var(--ui-control-py-lg)] [--ui-control-gap:var(--ui-control-gap-lg)] [--ui-control-icon-size:var(--ui-control-icon-size-lg)]',
filter: '[&>input]:h-13',
filter: '[--ui-control-px:var(--ui-control-py-lg)]',
empty: 'py-7 text-sm',
label: 'px-(--ui-control-py) py-[calc(var(--ui-control-py)-(var(--ui-control-text-lg--leading)-var(--ui-control-text-lg--line-height))/2)] text-[calc(var(--ui-control-text-lg)-0.125rem)]/[calc(var(--ui-control-text-lg--leading)-0.25rem)] gap-(--ui-control-gap)',
item: 'p-(--ui-control-py) text-(length:--ui-control-text-lg)/(--ui-control-text-lg--line-height) gap-(--ui-control-gap)',
Expand All @@ -98,7 +100,7 @@ export default defineTheme({
},
xl: {
content: '[--ui-control-py:var(--ui-control-py-xl)] [--ui-control-gap:var(--ui-control-gap-xl)] [--ui-control-icon-size:var(--ui-control-icon-size-xl)]',
filter: '[&>input]:h-14',
filter: '[--ui-control-px:var(--ui-control-py-xl)]',
empty: 'py-8 text-base',
label: 'px-(--ui-control-py) py-[calc(var(--ui-control-py)-(var(--ui-control-text-xl--leading)-var(--ui-control-text-xl--line-height))/2)] text-[calc(var(--ui-control-text-xl)-0.125rem)]/[calc(var(--ui-control-text-xl--leading)-0.25rem)] gap-(--ui-control-gap)',
item: 'p-(--ui-control-py) text-(length:--ui-control-text-xl)/(--ui-control-text-xl--line-height) gap-(--ui-control-gap)',
Expand Down
3 changes: 1 addition & 2 deletions src/runtime/theme/content/content-search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import { defineTheme } from '../../utils/theme'
export default defineTheme({
slots: {
modal: '',
// The search keeps the larger text of a field on every breakpoint
filter: '[--ui-control-text-step:0.125rem]'
filter: ''
},
variants: {
fullscreen: {
Expand Down
3 changes: 1 addition & 2 deletions src/runtime/theme/dashboard-search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import { defineTheme } from '../utils/theme'
export default defineTheme({
slots: {
modal: '',
// The search keeps the larger text of a field on every breakpoint
filter: '[--ui-control-text-step:0.125rem]'
filter: ''
},
variants: {
fullscreen: {
Expand Down
Loading
Loading