Skip to main content
Version: v1 (Current)

Combobox

Generated from public Vue/TypeScript exports by pnpm docs:generate. Edit source comments and stories to update this reference. Types describe the declared API; browser/device constraints are covered in the guides. This catalog reflects source commit fc6bfb108634735f1657e533206c3f8702ad357d; match your installed package and typed manifest before using an export. Source review does not establish registry-release availability.

Autocomplete​

import { Autocomplete } from '@gxp-dev/app-ui'

Repository source

Props​

NameTypeRequired / defaultDescription
modelValueAcceptableValue | AcceptableValue[] | undefined——
optionsAutocompleteOption[] | undefined[]—
multipleboolean | undefined——
placeholderstring | undefined"Search…"—
emptyTextstring | undefined"No results found."—
disabledboolean | undefined——
requiredboolean | undefined——
ignoreFilterboolean | undefined—Disable built-in filtering (e.g. when options are filtered server-side).
idstring | undefined——
namestring | undefined——

Events​

NameTypeRequired / defaultDescription
update:modelValue[value: AcceptableValue | AcceptableValue[]]——
search[term: string]——

Slots​

NameTypeRequired / defaultDescription
option{ option: AutocompleteOption; }——

Examples​

These are authored Storybook excerpts, not complete standalone modules. Relative imports refer to the story file; in an app import public components from @gxp-dev/app-ui. Default meta arguments are applied before each story.

Default​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import {
Autocomplete,
Combobox,
ComboboxAnchor,
ComboboxEmpty,
ComboboxGroup,
ComboboxInput,
ComboboxItem,
ComboboxList,
ComboboxTrigger,
} from '.'
import { Label } from '../label'
{
render: () => ({
components: { Autocomplete },
setup() {
const value = ref<string | null>(null)
return { value, frameworks }
},
template: `
<div class="w-80 space-y-2">
<Autocomplete v-model="value" :options="frameworks" placeholder="Search frameworks…" />
<p class="text-sm text-muted-foreground">Selected: {{ value ?? 'none' }}</p>
</div>
`,
}),
}

Multiple​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import {
Autocomplete,
Combobox,
ComboboxAnchor,
ComboboxEmpty,
ComboboxGroup,
ComboboxInput,
ComboboxItem,
ComboboxList,
ComboboxTrigger,
} from '.'
import { Label } from '../label'
{
render: () => ({
components: { Autocomplete },
setup() {
const value = ref<string[]>(['vue'])
return { value, frameworks }
},
template: `
<div class="w-80 space-y-2">
<Autocomplete v-model="value" :options="frameworks" multiple placeholder="Add frameworks…" />
<p class="text-sm text-muted-foreground">Selected: {{ value.join(', ') || 'none' }}</p>
</div>
`,
}),
}

Grouped​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import {
Autocomplete,
Combobox,
ComboboxAnchor,
ComboboxEmpty,
ComboboxGroup,
ComboboxInput,
ComboboxItem,
ComboboxList,
ComboboxTrigger,
} from '.'
import { Label } from '../label'
{
render: () => ({
components: { Autocomplete },
setup() {
const value = ref<string | null>(null)
const options = [
{ label: 'Vue', value: 'vue', group: 'Frontend' },
{ label: 'React', value: 'react', group: 'Frontend' },
{ label: 'Laravel', value: 'laravel', group: 'Backend' },
{ label: 'Rails', value: 'rails', group: 'Backend' },
]
return { value, options }
},
template: `
<div class="w-80">
<Autocomplete v-model="value" :options="options" placeholder="Search stacks…" />
</div>
`,
}),
}

Combobox​

import { Combobox } from '@gxp-dev/app-ui'

Repository source

Props​

NameTypeRequired / defaultDescription
openboolean | undefined—The controlled open state of the Combobox. Can be binded with v-model:open.
defaultOpenboolean | undefined—The open state of the combobox when it is initially rendered. <br> Use when you do not need to control its open state.
resetSearchTermOnBlurboolean | undefined—Whether to reset the searchTerm when the Combobox input blurred
resetSearchTermOnSelectboolean | undefined—Whether to reset the searchTerm when the Combobox value is selected
openOnFocusboolean | undefined—Whether to open the combobox when the input is focused
openOnClickboolean | undefined—Whether to open the combobox when the input is clicked
ignoreFilterboolean | undefined—When true, disable the default filters
resetModelValueOnClearboolean | undefined—When true the modelValue will be reset to null (or [] if multiple)
asChildboolean | undefined—Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details.
asAsTag | Component | undefined—The element or component this component should render as. Can be overwritten by asChild.
defaultValueAcceptableValue | AcceptableValue[] | undefined—The value of the listbox when initially rendered. Use when you do not need to control the state of the Listbox
modelValueAcceptableValue | AcceptableValue[] | undefined—The controlled value of the listbox. Can be binded with v-model.
disabledboolean | undefined—When true, prevents the user from interacting with listbox
namestring | undefined—The name of the field. Submitted with its owning form as part of a name/value pair.
requiredboolean | undefined—When true, indicates that the user must set the value before the owning form can be submitted.
bystring | ((a: AcceptableValue, b: AcceptableValue) => boolean) | undefined—Use this to compare objects by a particular field, or pass your own comparison function for complete control over how objects are compared.
dirDirection | undefined—The reading direction of the listbox when applicable. <br> If omitted, inherits globally from ConfigProvider or assumes LTR (left-to-right) reading mode.
multipleboolean | undefined—Whether multiple options can be selected or not.
highlightOnHoverboolean | undefined—When true, hover over item will trigger highlight

Events​

NameTypeRequired / defaultDescription
update:modelValue[value: AcceptableValue]——
update:open[value: boolean]——
highlight[payload: { ref: HTMLElement; value: AcceptableValue; } | undefined]——

Slots​

NameTypeRequired / defaultDescription
default{ open: boolean; modelValue: string | number | bigint | Record<string, any> | (string | number | bigint | Record<string, any> | null)[] | null; }——

Examples​

These are authored Storybook examples. Relative imports refer to the story file; in an app import public components from @gxp-dev/app-ui. Default meta arguments are applied before each story.

ComposedPrimitives​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import {
Autocomplete,
Combobox,
ComboboxAnchor,
ComboboxEmpty,
ComboboxGroup,
ComboboxInput,
ComboboxItem,
ComboboxList,
ComboboxTrigger,
} from '.'
import { Label } from '../label'
{
render: () => ({
components: {
Combobox,
ComboboxAnchor,
ComboboxEmpty,
ComboboxGroup,
ComboboxInput,
ComboboxItem,
ComboboxList,
ComboboxTrigger,
},
setup() {
const value = ref<string | null>(null)
return { value, frameworks }
},
template: `
<div class="w-80">
<Combobox v-model="value" open-on-click>
<ComboboxAnchor class="gap-2 rounded-md border border-input bg-background px-3">
<ComboboxInput unstyled class="h-10" placeholder="Search frameworks…" />
<ComboboxTrigger />
</ComboboxAnchor>
<ComboboxList>
<ComboboxEmpty>Nothing found.</ComboboxEmpty>
<ComboboxGroup heading="Frameworks">
<ComboboxItem v-for="fw in frameworks" :key="fw.value" :value="fw.value" :text-value="fw.label">
<span class="font-medium">{{ fw.label }}</span>
</ComboboxItem>
</ComboboxGroup>
</ComboboxList>
</Combobox>
</div>
`,
}),
}

Composition​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { Combobox, ComboboxAnchor, ComboboxInput, ComboboxList, ComboboxGroup, ComboboxItem, ComboboxSeparator } from './index'
{ render: () => ({ components: { Combobox, ComboboxAnchor, ComboboxInput, ComboboxList, ComboboxGroup, ComboboxItem, ComboboxSeparator }, template: `<Combobox><ComboboxAnchor><ComboboxInput placeholder="Search teams" /></ComboboxAnchor><ComboboxList><ComboboxGroup><ComboboxItem value="design">Design</ComboboxItem></ComboboxGroup><ComboboxSeparator /><ComboboxGroup><ComboboxItem value="engineering">Engineering</ComboboxItem></ComboboxGroup></ComboboxList></Combobox>` }) }

ComboboxAnchor​

import { ComboboxAnchor } from '@gxp-dev/app-ui'

Repository source

Props​

NameTypeRequired / defaultDescription
referenceReferenceElement | undefined—The reference (or anchor) element that is being referred to for positioning. If not provided will use the current component as anchor.
asChildboolean | undefined—Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details.
asAsTag | Component | undefined—The element or component this component should render as. Can be overwritten by asChild.

Slots​

NameTypeRequired / defaultDescription
default{}——

Examples​

These are authored Storybook examples. Relative imports refer to the story file; in an app import public components from @gxp-dev/app-ui. Default meta arguments are applied before each story.

ComposedPrimitives​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import {
Autocomplete,
Combobox,
ComboboxAnchor,
ComboboxEmpty,
ComboboxGroup,
ComboboxInput,
ComboboxItem,
ComboboxList,
ComboboxTrigger,
} from '.'
import { Label } from '../label'
{
render: () => ({
components: {
Combobox,
ComboboxAnchor,
ComboboxEmpty,
ComboboxGroup,
ComboboxInput,
ComboboxItem,
ComboboxList,
ComboboxTrigger,
},
setup() {
const value = ref<string | null>(null)
return { value, frameworks }
},
template: `
<div class="w-80">
<Combobox v-model="value" open-on-click>
<ComboboxAnchor class="gap-2 rounded-md border border-input bg-background px-3">
<ComboboxInput unstyled class="h-10" placeholder="Search frameworks…" />
<ComboboxTrigger />
</ComboboxAnchor>
<ComboboxList>
<ComboboxEmpty>Nothing found.</ComboboxEmpty>
<ComboboxGroup heading="Frameworks">
<ComboboxItem v-for="fw in frameworks" :key="fw.value" :value="fw.value" :text-value="fw.label">
<span class="font-medium">{{ fw.label }}</span>
</ComboboxItem>
</ComboboxGroup>
</ComboboxList>
</Combobox>
</div>
`,
}),
}

Composition​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { Combobox, ComboboxAnchor, ComboboxInput, ComboboxList, ComboboxGroup, ComboboxItem, ComboboxSeparator } from './index'
{ render: () => ({ components: { Combobox, ComboboxAnchor, ComboboxInput, ComboboxList, ComboboxGroup, ComboboxItem, ComboboxSeparator }, template: `<Combobox><ComboboxAnchor><ComboboxInput placeholder="Search teams" /></ComboboxAnchor><ComboboxList><ComboboxGroup><ComboboxItem value="design">Design</ComboboxItem></ComboboxGroup><ComboboxSeparator /><ComboboxGroup><ComboboxItem value="engineering">Engineering</ComboboxItem></ComboboxGroup></ComboboxList></Combobox>` }) }

ComboboxEmpty​

import { ComboboxEmpty } from '@gxp-dev/app-ui'

Repository source

Props​

NameTypeRequired / defaultDescription
asChildboolean | undefined—Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details.
asAsTag | Component | undefined—The element or component this component should render as. Can be overwritten by asChild.

Slots​

NameTypeRequired / defaultDescription
default{}——

Examples​

These are authored Storybook examples. Relative imports refer to the story file; in an app import public components from @gxp-dev/app-ui. Default meta arguments are applied before each story.

ComposedPrimitives​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import {
Autocomplete,
Combobox,
ComboboxAnchor,
ComboboxEmpty,
ComboboxGroup,
ComboboxInput,
ComboboxItem,
ComboboxList,
ComboboxTrigger,
} from '.'
import { Label } from '../label'
{
render: () => ({
components: {
Combobox,
ComboboxAnchor,
ComboboxEmpty,
ComboboxGroup,
ComboboxInput,
ComboboxItem,
ComboboxList,
ComboboxTrigger,
},
setup() {
const value = ref<string | null>(null)
return { value, frameworks }
},
template: `
<div class="w-80">
<Combobox v-model="value" open-on-click>
<ComboboxAnchor class="gap-2 rounded-md border border-input bg-background px-3">
<ComboboxInput unstyled class="h-10" placeholder="Search frameworks…" />
<ComboboxTrigger />
</ComboboxAnchor>
<ComboboxList>
<ComboboxEmpty>Nothing found.</ComboboxEmpty>
<ComboboxGroup heading="Frameworks">
<ComboboxItem v-for="fw in frameworks" :key="fw.value" :value="fw.value" :text-value="fw.label">
<span class="font-medium">{{ fw.label }}</span>
</ComboboxItem>
</ComboboxGroup>
</ComboboxList>
</Combobox>
</div>
`,
}),
}

ComboboxGroup​

import { ComboboxGroup } from '@gxp-dev/app-ui'

Repository source

Props​

NameTypeRequired / defaultDescription
asChildboolean | undefined—Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details.
asAsTag | Component | undefined—The element or component this component should render as. Can be overwritten by asChild.
headingstring | undefined——

Slots​

NameTypeRequired / defaultDescription
default{}——

Examples​

These are authored Storybook examples. Relative imports refer to the story file; in an app import public components from @gxp-dev/app-ui. Default meta arguments are applied before each story.

ComposedPrimitives​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import {
Autocomplete,
Combobox,
ComboboxAnchor,
ComboboxEmpty,
ComboboxGroup,
ComboboxInput,
ComboboxItem,
ComboboxList,
ComboboxTrigger,
} from '.'
import { Label } from '../label'
{
render: () => ({
components: {
Combobox,
ComboboxAnchor,
ComboboxEmpty,
ComboboxGroup,
ComboboxInput,
ComboboxItem,
ComboboxList,
ComboboxTrigger,
},
setup() {
const value = ref<string | null>(null)
return { value, frameworks }
},
template: `
<div class="w-80">
<Combobox v-model="value" open-on-click>
<ComboboxAnchor class="gap-2 rounded-md border border-input bg-background px-3">
<ComboboxInput unstyled class="h-10" placeholder="Search frameworks…" />
<ComboboxTrigger />
</ComboboxAnchor>
<ComboboxList>
<ComboboxEmpty>Nothing found.</ComboboxEmpty>
<ComboboxGroup heading="Frameworks">
<ComboboxItem v-for="fw in frameworks" :key="fw.value" :value="fw.value" :text-value="fw.label">
<span class="font-medium">{{ fw.label }}</span>
</ComboboxItem>
</ComboboxGroup>
</ComboboxList>
</Combobox>
</div>
`,
}),
}

Composition​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { Combobox, ComboboxAnchor, ComboboxInput, ComboboxList, ComboboxGroup, ComboboxItem, ComboboxSeparator } from './index'
{ render: () => ({ components: { Combobox, ComboboxAnchor, ComboboxInput, ComboboxList, ComboboxGroup, ComboboxItem, ComboboxSeparator }, template: `<Combobox><ComboboxAnchor><ComboboxInput placeholder="Search teams" /></ComboboxAnchor><ComboboxList><ComboboxGroup><ComboboxItem value="design">Design</ComboboxItem></ComboboxGroup><ComboboxSeparator /><ComboboxGroup><ComboboxItem value="engineering">Engineering</ComboboxItem></ComboboxGroup></ComboboxList></Combobox>` }) }

ComboboxInput​

import { ComboboxInput } from '@gxp-dev/app-ui'

Repository source

Props​

NameTypeRequired / defaultDescription
displayValue((val: any) => string) | undefined—The display value of input for selected item. Does not work with multiple.
modelValuestring | undefined—The controlled value of the filter. Can be binded with v-model.
autoFocusboolean | undefined—Focus on element when mounted.
disabledboolean | undefined—When true, prevents the user from interacting with item
asChildboolean | undefined—Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details.
asAsTag | Component | undefined—The element or component this component should render as. Can be overwritten by asChild.
unstyledboolean | undefined——

Events​

NameTypeRequired / defaultDescription
update:modelValue[string]——

Examples​

These are authored Storybook examples. Relative imports refer to the story file; in an app import public components from @gxp-dev/app-ui. Default meta arguments are applied before each story.

ComposedPrimitives​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import {
Autocomplete,
Combobox,
ComboboxAnchor,
ComboboxEmpty,
ComboboxGroup,
ComboboxInput,
ComboboxItem,
ComboboxList,
ComboboxTrigger,
} from '.'
import { Label } from '../label'
{
render: () => ({
components: {
Combobox,
ComboboxAnchor,
ComboboxEmpty,
ComboboxGroup,
ComboboxInput,
ComboboxItem,
ComboboxList,
ComboboxTrigger,
},
setup() {
const value = ref<string | null>(null)
return { value, frameworks }
},
template: `
<div class="w-80">
<Combobox v-model="value" open-on-click>
<ComboboxAnchor class="gap-2 rounded-md border border-input bg-background px-3">
<ComboboxInput unstyled class="h-10" placeholder="Search frameworks…" />
<ComboboxTrigger />
</ComboboxAnchor>
<ComboboxList>
<ComboboxEmpty>Nothing found.</ComboboxEmpty>
<ComboboxGroup heading="Frameworks">
<ComboboxItem v-for="fw in frameworks" :key="fw.value" :value="fw.value" :text-value="fw.label">
<span class="font-medium">{{ fw.label }}</span>
</ComboboxItem>
</ComboboxGroup>
</ComboboxList>
</Combobox>
</div>
`,
}),
}

Composition​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { Combobox, ComboboxAnchor, ComboboxInput, ComboboxList, ComboboxGroup, ComboboxItem, ComboboxSeparator } from './index'
{ render: () => ({ components: { Combobox, ComboboxAnchor, ComboboxInput, ComboboxList, ComboboxGroup, ComboboxItem, ComboboxSeparator }, template: `<Combobox><ComboboxAnchor><ComboboxInput placeholder="Search teams" /></ComboboxAnchor><ComboboxList><ComboboxGroup><ComboboxItem value="design">Design</ComboboxItem></ComboboxGroup><ComboboxSeparator /><ComboboxGroup><ComboboxItem value="engineering">Engineering</ComboboxItem></ComboboxGroup></ComboboxList></Combobox>` }) }

ComboboxItem​

import { ComboboxItem } from '@gxp-dev/app-ui'

Repository source

Props​

NameTypeRequired / defaultDescription
textValuestring | undefined—A string representation of the item contents. If the children are not plain text, then the textValue prop must also be set to a plain text representation, which will be used for autocomplete in the ComboBox.
valueAcceptableValueRequiredThe value given as data when submitted with a name.
disabledboolean | undefined—When true, prevents the user from interacting with the item.
asChildboolean | undefined—Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details.
asAsTag | Component | undefined—The element or component this component should render as. Can be overwritten by asChild.

Events​

NameTypeRequired / defaultDescription
select[event: SelectEvent$3<AcceptableValue>]——

Slots​

NameTypeRequired / defaultDescription
default{}——
indicator{}——

Examples​

These are authored Storybook examples. Relative imports refer to the story file; in an app import public components from @gxp-dev/app-ui. Default meta arguments are applied before each story.

ComposedPrimitives​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import {
Autocomplete,
Combobox,
ComboboxAnchor,
ComboboxEmpty,
ComboboxGroup,
ComboboxInput,
ComboboxItem,
ComboboxList,
ComboboxTrigger,
} from '.'
import { Label } from '../label'
{
render: () => ({
components: {
Combobox,
ComboboxAnchor,
ComboboxEmpty,
ComboboxGroup,
ComboboxInput,
ComboboxItem,
ComboboxList,
ComboboxTrigger,
},
setup() {
const value = ref<string | null>(null)
return { value, frameworks }
},
template: `
<div class="w-80">
<Combobox v-model="value" open-on-click>
<ComboboxAnchor class="gap-2 rounded-md border border-input bg-background px-3">
<ComboboxInput unstyled class="h-10" placeholder="Search frameworks…" />
<ComboboxTrigger />
</ComboboxAnchor>
<ComboboxList>
<ComboboxEmpty>Nothing found.</ComboboxEmpty>
<ComboboxGroup heading="Frameworks">
<ComboboxItem v-for="fw in frameworks" :key="fw.value" :value="fw.value" :text-value="fw.label">
<span class="font-medium">{{ fw.label }}</span>
</ComboboxItem>
</ComboboxGroup>
</ComboboxList>
</Combobox>
</div>
`,
}),
}

Composition​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { Combobox, ComboboxAnchor, ComboboxInput, ComboboxList, ComboboxGroup, ComboboxItem, ComboboxSeparator } from './index'
{ render: () => ({ components: { Combobox, ComboboxAnchor, ComboboxInput, ComboboxList, ComboboxGroup, ComboboxItem, ComboboxSeparator }, template: `<Combobox><ComboboxAnchor><ComboboxInput placeholder="Search teams" /></ComboboxAnchor><ComboboxList><ComboboxGroup><ComboboxItem value="design">Design</ComboboxItem></ComboboxGroup><ComboboxSeparator /><ComboboxGroup><ComboboxItem value="engineering">Engineering</ComboboxItem></ComboboxGroup></ComboboxList></Combobox>` }) }

ComboboxList​

import { ComboboxList } from '@gxp-dev/app-ui'

Repository source

Props​

NameTypeRequired / defaultDescription
forceMountboolean | undefined—Used to force mounting when more control is needed. Useful when controlling animation with Vue animation libraries.
position"popper" | "inline" | undefined"popper"The positioning mode to use, <br> inline is the default and you can control the position using CSS. <br> popper positions content in the same way as our other primitives, for example Popover or DropdownMenu.
bodyLockboolean | undefined—The document.body will be lock, and scrolling will be disabled.
hideWhenEmptyboolean | undefined—When true, hides the content when there are no items matching the filter.
memoDependenciesunknown[] | undefined—Reactive dependencies that should invalidate the memoized content subtree.
side"top" | "right" | "bottom" | "left" | undefined—The preferred side of the trigger to render against when open. Will be reversed when collisions occur and avoidCollisions is enabled.
sideOffsetnumber | undefined4The distance in pixels from the trigger.
sideFlipboolean | undefined—Flip to the opposite side when colliding with boundary.
align"start" | "center" | "end" | undefined"start"The preferred alignment against the trigger. May change when collisions occur.
alignOffsetnumber | undefined—An offset in pixels from the start or end alignment options.
alignFlipboolean | undefined—Flip alignment when colliding with boundary. May only occur when prioritizePosition is true.
avoidCollisionsboolean | undefined—When true, overrides the side and align preferences to prevent collisions with boundary edges.
collisionBoundaryElement | (Element | null)[] | null | undefined—The element used as the collision boundary. By default this is the viewport, though you can provide additional element(s) to be included in this check.
collisionPaddingnumber | Partial<Record<"top" | "right" | "bottom" | "left", number>> | undefined—The distance in pixels from the boundary edges where collision detection should occur. Accepts a number (same for all sides), or a partial padding object, for example: { top: 20, left: 20 }.
arrowPaddingnumber | undefined—The padding between the arrow and the edges of the content. If your content has border-radius, this will prevent it from overflowing the corners.
hideShiftedArrowboolean | undefined—When true, hides the arrow when it cannot be centered to the reference element.
sticky"partial" | "always" | undefined—The sticky behavior on the align axis. partial will keep the content in the boundary as long as the trigger is at least partially in the boundary whilst "always" will keep the content in the boundary regardless.
hideWhenDetachedboolean | undefined—Whether to hide the content when the trigger becomes fully occluded.
positionStrategy"absolute" | "fixed" | undefined—The type of CSS position property to use.
updatePositionStrategy"always" | "optimized" | undefined—Strategy to update the position of the floating element on every animation frame.
disableUpdateOnLayoutShiftboolean | undefined—Whether to disable the update position for the content when the layout shifted.
prioritizePositionboolean | undefined—Force content to be position within the viewport. Might overlap the reference element, which may not be desired.
referenceReferenceElement | undefined—The custom element or virtual element that will be set as the reference to position the floating element. If provided, it will replace the default anchor element.
dirDirection | undefined—The reading direction of the popper content when applicable. <br> If omitted, inherits globally from ConfigProvider or assumes LTR (left-to-right) reading mode.
asChildboolean | undefined—Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details.
asAsTag | Component | undefined—The element or component this component should render as. Can be overwritten by asChild.
disableOutsidePointerEventsboolean | undefined—When true, hover/focus/click interactions will be disabled on elements outside the DismissableLayer. Users will need to click twice on outside elements to interact with them: once to close the DismissableLayer, and again to trigger the element.
portalTostring | HTMLElement | undefined——
disablePortalboolean | undefined——

Events​

NameTypeRequired / defaultDescription
escapeKeyDown[event: KeyboardEvent]——
pointerDownOutside[event: PointerDownOutsideEvent]——
focusOutside[event: FocusOutsideEvent]——
interactOutside[event: PointerDownOutsideEvent | FocusOutsideEvent]——

Slots​

NameTypeRequired / defaultDescription
default{}——

Examples​

These are authored Storybook examples. Relative imports refer to the story file; in an app import public components from @gxp-dev/app-ui. Default meta arguments are applied before each story.

ComposedPrimitives​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import {
Autocomplete,
Combobox,
ComboboxAnchor,
ComboboxEmpty,
ComboboxGroup,
ComboboxInput,
ComboboxItem,
ComboboxList,
ComboboxTrigger,
} from '.'
import { Label } from '../label'
{
render: () => ({
components: {
Combobox,
ComboboxAnchor,
ComboboxEmpty,
ComboboxGroup,
ComboboxInput,
ComboboxItem,
ComboboxList,
ComboboxTrigger,
},
setup() {
const value = ref<string | null>(null)
return { value, frameworks }
},
template: `
<div class="w-80">
<Combobox v-model="value" open-on-click>
<ComboboxAnchor class="gap-2 rounded-md border border-input bg-background px-3">
<ComboboxInput unstyled class="h-10" placeholder="Search frameworks…" />
<ComboboxTrigger />
</ComboboxAnchor>
<ComboboxList>
<ComboboxEmpty>Nothing found.</ComboboxEmpty>
<ComboboxGroup heading="Frameworks">
<ComboboxItem v-for="fw in frameworks" :key="fw.value" :value="fw.value" :text-value="fw.label">
<span class="font-medium">{{ fw.label }}</span>
</ComboboxItem>
</ComboboxGroup>
</ComboboxList>
</Combobox>
</div>
`,
}),
}

Composition​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { Combobox, ComboboxAnchor, ComboboxInput, ComboboxList, ComboboxGroup, ComboboxItem, ComboboxSeparator } from './index'
{ render: () => ({ components: { Combobox, ComboboxAnchor, ComboboxInput, ComboboxList, ComboboxGroup, ComboboxItem, ComboboxSeparator }, template: `<Combobox><ComboboxAnchor><ComboboxInput placeholder="Search teams" /></ComboboxAnchor><ComboboxList><ComboboxGroup><ComboboxItem value="design">Design</ComboboxItem></ComboboxGroup><ComboboxSeparator /><ComboboxGroup><ComboboxItem value="engineering">Engineering</ComboboxItem></ComboboxGroup></ComboboxList></Combobox>` }) }

ComboboxSeparator​

import { ComboboxSeparator } from '@gxp-dev/app-ui'

Repository source

Props​

NameTypeRequired / defaultDescription
asChildboolean | undefined—Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details.
asAsTag | Component | undefined—The element or component this component should render as. Can be overwritten by asChild.

Slots​

NameTypeRequired / defaultDescription
default{}——

Examples​

These are authored Storybook examples. Relative imports refer to the story file; in an app import public components from @gxp-dev/app-ui. Default meta arguments are applied before each story.

Composition​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { Combobox, ComboboxAnchor, ComboboxInput, ComboboxList, ComboboxGroup, ComboboxItem, ComboboxSeparator } from './index'
{ render: () => ({ components: { Combobox, ComboboxAnchor, ComboboxInput, ComboboxList, ComboboxGroup, ComboboxItem, ComboboxSeparator }, template: `<Combobox><ComboboxAnchor><ComboboxInput placeholder="Search teams" /></ComboboxAnchor><ComboboxList><ComboboxGroup><ComboboxItem value="design">Design</ComboboxItem></ComboboxGroup><ComboboxSeparator /><ComboboxGroup><ComboboxItem value="engineering">Engineering</ComboboxItem></ComboboxGroup></ComboboxList></Combobox>` }) }

ComboboxTrigger​

import { ComboboxTrigger } from '@gxp-dev/app-ui'

Repository source

Props​

NameTypeRequired / defaultDescription
disabledboolean | undefined—When true, prevents the user from interacting with item
asChildboolean | undefined—Change the default rendered element for the one passed as a child, merging their props and behavior. Read our Composition guide for more details.
asAsTag | Component | undefined—The element or component this component should render as. Can be overwritten by asChild.

Slots​

NameTypeRequired / defaultDescription
default{}——

Examples​

These are authored Storybook examples. Relative imports refer to the story file; in an app import public components from @gxp-dev/app-ui. Default meta arguments are applied before each story.

ComposedPrimitives​

import type { Meta, StoryObj } from '@storybook/vue3-vite'
import { ref } from 'vue'
import {
Autocomplete,
Combobox,
ComboboxAnchor,
ComboboxEmpty,
ComboboxGroup,
ComboboxInput,
ComboboxItem,
ComboboxList,
ComboboxTrigger,
} from '.'
import { Label } from '../label'
{
render: () => ({
components: {
Combobox,
ComboboxAnchor,
ComboboxEmpty,
ComboboxGroup,
ComboboxInput,
ComboboxItem,
ComboboxList,
ComboboxTrigger,
},
setup() {
const value = ref<string | null>(null)
return { value, frameworks }
},
template: `
<div class="w-80">
<Combobox v-model="value" open-on-click>
<ComboboxAnchor class="gap-2 rounded-md border border-input bg-background px-3">
<ComboboxInput unstyled class="h-10" placeholder="Search frameworks…" />
<ComboboxTrigger />
</ComboboxAnchor>
<ComboboxList>
<ComboboxEmpty>Nothing found.</ComboboxEmpty>
<ComboboxGroup heading="Frameworks">
<ComboboxItem v-for="fw in frameworks" :key="fw.value" :value="fw.value" :text-value="fw.label">
<span class="font-medium">{{ fw.label }}</span>
</ComboboxItem>
</ComboboxGroup>
</ComboboxList>
</Combobox>
</div>
`,
}),
}