Select
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 commitfc6bfb108634735f1657e533206c3f8702ad357d; match your installed package and typed manifest before using an export. Source review does not establish registry-release availability.
Select
import { Select } from '@gxp-dev/app-ui'
Props
| Name | Type | Required / default | Description |
|---|---|---|---|
open | boolean | undefined | — | The controlled open state of the Select. Can be bind as v-model:open. |
defaultOpen | boolean | undefined | — | The open state of the select when it is initially rendered. Use when you do not need to control its open state. |
defaultValue | AcceptableValue | AcceptableValue[] | undefined | — | The value of the select when initially rendered. Use when you do not need to control the state of the Select |
modelValue | AcceptableValue | AcceptableValue[] | undefined | — | The controlled value of the Select. Can be bind as v-model. |
nullableValue | string | undefined | — | The value of the hidden native select option when the model value is nullish. |
by | string | ((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. |
dir | Direction | undefined | — | The reading direction of the combobox when applicable. <br> If omitted, inherits globally from ConfigProvider or assumes LTR (left-to-right) reading mode. |
multiple | boolean | undefined | — | Whether multiple options can be selected or not. |
autocomplete | string | undefined | — | Native html input autocomplete attribute. |
disabled | boolean | undefined | — | When true, prevents the user from interacting with Select |
name | string | undefined | — | The name of the field. Submitted with its owning form as part of a name/value pair. |
required | boolean | undefined | — | When true, indicates that the user must set the value before the owning form can be submitted. |
Events
| Name | Type | Required / default | Description |
|---|---|---|---|
update:modelValue | [value: AcceptableValue] | — | — |
update:open | [value: boolean] | — | — |
Slots
| Name | Type | Required / default | Description |
|---|---|---|---|
default | {} | — | — |
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 {
Select,
SelectContent,
SelectGroup,
SelectItem,
SelectLabel,
SelectSeparator,
SelectTrigger,
SelectValue,
} from '.'
import { Label } from '../label'
{
render: () => ({
components: {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
},
template: `
<Select>
<SelectTrigger class="w-[280px]">
<SelectValue placeholder="Select a fruit..." />
</SelectTrigger>
<SelectContent>
<SelectItem value="apple">Apple</SelectItem>
<SelectItem value="banana">Banana</SelectItem>
<SelectItem value="cherry">Cherry</SelectItem>
<SelectItem value="grape">Grape</SelectItem>
<SelectItem value="orange">Orange</SelectItem>
</SelectContent>
</Select>
`,
}),
}
WithGroups
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import {
Select,
SelectContent,
SelectGroup,
SelectItem,
SelectLabel,
SelectSeparator,
SelectTrigger,
SelectValue,
} from '.'
import { Label } from '../label'
{
name: 'With Groups',
render: () => ({
components: {
Select,
SelectContent,
SelectGroup,
SelectItem,
SelectLabel,
SelectSeparator,
SelectTrigger,
SelectValue,
},
template: `
<Select>
<SelectTrigger class="w-[280px]">
<SelectValue placeholder="Select a food..." />
</SelectTrigger>
<SelectContent>
<SelectGroup>
<SelectLabel>Fruits</SelectLabel>
<SelectItem value="apple">Apple</SelectItem>
<SelectItem value="banana">Banana</SelectItem>
<SelectItem value="cherry">Cherry</SelectItem>
</SelectGroup>
<SelectSeparator />
<SelectGroup>
<SelectLabel>Vegetables</SelectLabel>
<SelectItem value="carrot">Carrot</SelectItem>
<SelectItem value="broccoli">Broccoli</SelectItem>
<SelectItem value="spinach">Spinach</SelectItem>
</SelectGroup>
<SelectSeparator />
<SelectGroup>
<SelectLabel>Grains</SelectLabel>
<SelectItem value="rice">Rice</SelectItem>
<SelectItem value="wheat">Wheat</SelectItem>
<SelectItem value="oats">Oats</SelectItem>
</SelectGroup>
</SelectContent>
</Select>
`,
}),
}
Disabled
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import {
Select,
SelectContent,
SelectGroup,
SelectItem,
SelectLabel,
SelectSeparator,
SelectTrigger,
SelectValue,
} from '.'
import { Label } from '../label'
{
name: 'Disabled',
render: () => ({
components: {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
},
template: `
<Select disabled>
<SelectTrigger class="w-[280px]">
<SelectValue placeholder="Select a fruit..." />
</SelectTrigger>
<SelectContent>
<SelectItem value="apple">Apple</SelectItem>
<SelectItem value="banana">Banana</SelectItem>
<SelectItem value="cherry">Cherry</SelectItem>
</SelectContent>
</Select>
`,
}),
}
SelectContent
import { SelectContent } from '@gxp-dev/app-ui'
Props
| Name | Type | Required / default | Description |
|---|---|---|---|
forceMount | boolean | undefined | — | Used to force mounting when more control is needed. Useful when controlling animation with Vue animation libraries. |
position | "popper" | "item-aligned" | undefined | "popper" | The positioning mode to use item-aligned (default) - behaves similarly to a native MacOS menu by positioning content relative to the active item. <br> popper - positions content in the same way as our other primitives, for example Popover or DropdownMenu. |
bodyLock | boolean | undefined | — | The document.body will be lock, and scrolling will be disabled. |
memoDependencies | unknown[] | 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. |
sideOffset | number | undefined | — | The distance in pixels from the trigger. |
sideFlip | boolean | undefined | — | Flip to the opposite side when colliding with boundary. |
align | "start" | "center" | "end" | undefined | — | The preferred alignment against the trigger. May change when collisions occur. |
alignOffset | number | undefined | — | An offset in pixels from the start or end alignment options. |
alignFlip | boolean | undefined | — | Flip alignment when colliding with boundary. May only occur when prioritizePosition is true. |
avoidCollisions | boolean | undefined | — | When true, overrides the side and align preferences to prevent collisions with boundary edges. |
collisionBoundary | Element | (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. |
collisionPadding | number | 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 }. |
arrowPadding | number | 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. |
hideShiftedArrow | boolean | 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. |
hideWhenDetached | boolean | 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. |
disableUpdateOnLayoutShift | boolean | undefined | — | Whether to disable the update position for the content when the layout shifted. |
prioritizePosition | boolean | undefined | — | Force content to be position within the viewport. Might overlap the reference element, which may not be desired. |
reference | ReferenceElement | 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. |
dir | Direction | 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. |
asChild | boolean | 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. |
as | AsTag | Component | undefined | — | The element or component this component should render as. Can be overwritten by asChild. |
disableOutsidePointerEvents | boolean | 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. |
portalTo | string | HTMLElement | undefined | — | — |
disablePortal | boolean | undefined | — | — |
Events
| Name | Type | Required / default | Description |
|---|---|---|---|
escapeKeyDown | [event: KeyboardEvent] | — | — |
pointerDownOutside | [event: PointerDownOutsideEvent] | — | — |
closeAutoFocus | [event: Event] | — | — |
Slots
| Name | Type | Required / default | Description |
|---|---|---|---|
scroll-up | {} | — | — |
default | {} | — | — |
scroll-down | {} | — | — |
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.
Default
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import {
Select,
SelectContent,
SelectGroup,
SelectItem,
SelectLabel,
SelectSeparator,
SelectTrigger,
SelectValue,
} from '.'
import { Label } from '../label'
{
render: () => ({
components: {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
},
template: `
<Select>
<SelectTrigger class="w-[280px]">
<SelectValue placeholder="Select a fruit..." />
</SelectTrigger>
<SelectContent>
<SelectItem value="apple">Apple</SelectItem>
<SelectItem value="banana">Banana</SelectItem>
<SelectItem value="cherry">Cherry</SelectItem>
<SelectItem value="grape">Grape</SelectItem>
<SelectItem value="orange">Orange</SelectItem>
</SelectContent>
</Select>
`,
}),
}
WithGroups
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import {
Select,
SelectContent,
SelectGroup,
SelectItem,
SelectLabel,
SelectSeparator,
SelectTrigger,
SelectValue,
} from '.'
import { Label } from '../label'
{
name: 'With Groups',
render: () => ({
components: {
Select,
SelectContent,
SelectGroup,
SelectItem,
SelectLabel,
SelectSeparator,
SelectTrigger,
SelectValue,
},
template: `
<Select>
<SelectTrigger class="w-[280px]">
<SelectValue placeholder="Select a food..." />
</SelectTrigger>
<SelectContent>
<SelectGroup>
<SelectLabel>Fruits</SelectLabel>
<SelectItem value="apple">Apple</SelectItem>
<SelectItem value="banana">Banana</SelectItem>
<SelectItem value="cherry">Cherry</SelectItem>
</SelectGroup>
<SelectSeparator />
<SelectGroup>
<SelectLabel>Vegetables</SelectLabel>
<SelectItem value="carrot">Carrot</SelectItem>
<SelectItem value="broccoli">Broccoli</SelectItem>
<SelectItem value="spinach">Spinach</SelectItem>
</SelectGroup>
<SelectSeparator />
<SelectGroup>
<SelectLabel>Grains</SelectLabel>
<SelectItem value="rice">Rice</SelectItem>
<SelectItem value="wheat">Wheat</SelectItem>
<SelectItem value="oats">Oats</SelectItem>
</SelectGroup>
</SelectContent>
</Select>
`,
}),
}
Disabled
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import {
Select,
SelectContent,
SelectGroup,
SelectItem,
SelectLabel,
SelectSeparator,
SelectTrigger,
SelectValue,
} from '.'
import { Label } from '../label'
{
name: 'Disabled',
render: () => ({
components: {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
},
template: `
<Select disabled>
<SelectTrigger class="w-[280px]">
<SelectValue placeholder="Select a fruit..." />
</SelectTrigger>
<SelectContent>
<SelectItem value="apple">Apple</SelectItem>
<SelectItem value="banana">Banana</SelectItem>
<SelectItem value="cherry">Cherry</SelectItem>
</SelectContent>
</Select>
`,
}),
}
SelectGroup
import { SelectGroup } from '@gxp-dev/app-ui'
Props
| Name | Type | Required / default | Description |
|---|---|---|---|
asChild | boolean | 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. |
as | AsTag | Component | undefined | — | The element or component this component should render as. Can be overwritten by asChild. |
Slots
| Name | Type | Required / default | Description |
|---|---|---|---|
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.
WithGroups
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import {
Select,
SelectContent,
SelectGroup,
SelectItem,
SelectLabel,
SelectSeparator,
SelectTrigger,
SelectValue,
} from '.'
import { Label } from '../label'
{
name: 'With Groups',
render: () => ({
components: {
Select,
SelectContent,
SelectGroup,
SelectItem,
SelectLabel,
SelectSeparator,
SelectTrigger,
SelectValue,
},
template: `
<Select>
<SelectTrigger class="w-[280px]">
<SelectValue placeholder="Select a food..." />
</SelectTrigger>
<SelectContent>
<SelectGroup>
<SelectLabel>Fruits</SelectLabel>
<SelectItem value="apple">Apple</SelectItem>
<SelectItem value="banana">Banana</SelectItem>
<SelectItem value="cherry">Cherry</SelectItem>
</SelectGroup>
<SelectSeparator />
<SelectGroup>
<SelectLabel>Vegetables</SelectLabel>
<SelectItem value="carrot">Carrot</SelectItem>
<SelectItem value="broccoli">Broccoli</SelectItem>
<SelectItem value="spinach">Spinach</SelectItem>
</SelectGroup>
<SelectSeparator />
<SelectGroup>
<SelectLabel>Grains</SelectLabel>
<SelectItem value="rice">Rice</SelectItem>
<SelectItem value="wheat">Wheat</SelectItem>
<SelectItem value="oats">Oats</SelectItem>
</SelectGroup>
</SelectContent>
</Select>
`,
}),
}
Showcase
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import {
Select,
SelectContent,
SelectGroup,
SelectItem,
SelectLabel,
SelectSeparator,
SelectTrigger,
SelectValue,
} from '.'
import { Label } from '../label'
{
name: 'Showcase',
render: () => ({
components: {
Select,
SelectContent,
SelectGroup,
SelectItem,
SelectLabel,
SelectSeparator,
SelectTrigger,
SelectValue,
Label,
},
template: `
<div class="space-y-8">
<div>
<h3 class="text-lg font-semibold mb-4 text-white">Basic Select</h3>
<div class="grid w-full max-w-sm items-center gap-1.5">
<Label for="fruit">Favorite Fruit</Label>
<Select>
<SelectTrigger id="fruit" class="w-[280px]">
<SelectValue placeholder="Select a fruit..." />
</SelectTrigger>
<SelectContent>
<SelectItem value="apple">Apple</SelectItem>
<SelectItem value="banana">Banana</SelectItem>
<SelectItem value="cherry">Cherry</SelectItem>
<SelectItem value="grape">Grape</SelectItem>
<SelectItem value="orange">Orange</SelectItem>
</SelectContent>
</Select>
</div>
</div>
<div>
<h3 class="text-lg font-semibold mb-4 text-white">Grouped Select</h3>
<div class="grid w-full max-w-sm items-center gap-1.5">
<Label for="timezone">Timezone</Label>
<Select>
<SelectTrigger id="timezone" class="w-[280px]">
<SelectValue placeholder="Select a timezone..." />
</SelectTrigger>
<SelectContent>
<SelectGroup>
<SelectLabel>North America</SelectLabel>
<SelectItem value="est">Eastern Standard Time (EST)</SelectItem>
<SelectItem value="cst">Central Standard Time (CST)</SelectItem>
<SelectItem value="mst">Mountain Standard Time (MST)</SelectItem>
<SelectItem value="pst">Pacific Standard Time (PST)</SelectItem>
</SelectGroup>
<SelectSeparator />
<SelectGroup>
<SelectLabel>Europe</SelectLabel>
<SelectItem value="gmt">Greenwich Mean Time (GMT)</SelectItem>
<SelectItem value="cet">Central European Time (CET)</SelectItem>
<SelectItem value="eet">Eastern European Time (EET)</SelectItem>
</SelectGroup>
</SelectContent>
</Select>
</div>
</div>
<div>
<h3 class="text-lg font-semibold mb-4 text-white">Disabled Select</h3>
<div class="grid w-full max-w-sm items-center gap-1.5">
<Label for="disabled">Disabled Field</Label>
<Select disabled>
<SelectTrigger id="disabled" class="w-[280px]">
<SelectValue placeholder="Cannot select..." />
</SelectTrigger>
<SelectContent>
<SelectItem value="option1">Option 1</SelectItem>
<SelectItem value="option2">Option 2</SelectItem>
</SelectContent>
</Select>
</div>
</div>
<div>
<h3 class="text-lg font-semibold mb-4 text-white">Form Layout</h3>
<div class="grid gap-4 max-w-md">
<div class="grid w-full items-center gap-1.5">
<Label for="country">Country</Label>
<Select>
<SelectTrigger id="country">
<SelectValue placeholder="Select your country..." />
</SelectTrigger>
<SelectContent>
<SelectItem value="us">United States</SelectItem>
<SelectItem value="uk">United Kingdom</SelectItem>
<SelectItem value="ca">Canada</SelectItem>
<SelectItem value="au">Australia</SelectItem>
<SelectItem value="de">Germany</SelectItem>
<SelectItem value="fr">France</SelectItem>
</SelectContent>
</Select>
</div>
<div class="grid w-full items-center gap-1.5">
<Label for="language">Preferred Language</Label>
<Select default-value="en">
<SelectTrigger id="language">
<SelectValue placeholder="Select a language..." />
</SelectTrigger>
<SelectContent>
<SelectItem value="en">English</SelectItem>
<SelectItem value="es">Spanish</SelectItem>
<SelectItem value="fr">French</SelectItem>
<SelectItem value="de">German</SelectItem>
<SelectItem value="ja">Japanese</SelectItem>
</SelectContent>
</Select>
</div>
<div class="grid w-full items-center gap-1.5">
<Label for="role">Role</Label>
<Select>
<SelectTrigger id="role">
<SelectValue placeholder="Select a role..." />
</SelectTrigger>
<SelectContent>
<SelectGroup>
<SelectLabel>Engineering</SelectLabel>
<SelectItem value="frontend">Frontend Developer</SelectItem>
<SelectItem value="backend">Backend Developer</SelectItem>
<SelectItem value="fullstack">Fullstack Developer</SelectItem>
</SelectGroup>
<SelectSeparator />
<SelectGroup>
<SelectLabel>Design</SelectLabel>
<SelectItem value="ui">UI Designer</SelectItem>
<SelectItem value="ux">UX Designer</SelectItem>
<SelectItem value="product">Product Designer</SelectItem>
</SelectGroup>
</SelectContent>
</Select>
</div>
</div>
</div>
</div>
`,
}),
}
SelectItem
import { SelectItem } from '@gxp-dev/app-ui'
Props
| Name | Type | Required / default | Description |
|---|---|---|---|
value | AcceptableValue | Required | The value given as data when submitted with a name. |
disabled | boolean | undefined | — | When true, prevents the user from interacting with the item. |
textValue | string | undefined | — | Optional text used for typeahead purposes. By default the typeahead behavior will use the .textContent of the SelectItemText part. Use this when the content is complex, or you have non-textual content inside. |
asChild | boolean | 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. |
as | AsTag | Component | undefined | — | The element or component this component should render as. Can be overwritten by asChild. |
Slots
| Name | Type | Required / default | Description |
|---|---|---|---|
text | {} | — | — |
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.
Default
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import {
Select,
SelectContent,
SelectGroup,
SelectItem,
SelectLabel,
SelectSeparator,
SelectTrigger,
SelectValue,
} from '.'
import { Label } from '../label'
{
render: () => ({
components: {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
},
template: `
<Select>
<SelectTrigger class="w-[280px]">
<SelectValue placeholder="Select a fruit..." />
</SelectTrigger>
<SelectContent>
<SelectItem value="apple">Apple</SelectItem>
<SelectItem value="banana">Banana</SelectItem>
<SelectItem value="cherry">Cherry</SelectItem>
<SelectItem value="grape">Grape</SelectItem>
<SelectItem value="orange">Orange</SelectItem>
</SelectContent>
</Select>
`,
}),
}
WithGroups
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import {
Select,
SelectContent,
SelectGroup,
SelectItem,
SelectLabel,
SelectSeparator,
SelectTrigger,
SelectValue,
} from '.'
import { Label } from '../label'
{
name: 'With Groups',
render: () => ({
components: {
Select,
SelectContent,
SelectGroup,
SelectItem,
SelectLabel,
SelectSeparator,
SelectTrigger,
SelectValue,
},
template: `
<Select>
<SelectTrigger class="w-[280px]">
<SelectValue placeholder="Select a food..." />
</SelectTrigger>
<SelectContent>
<SelectGroup>
<SelectLabel>Fruits</SelectLabel>
<SelectItem value="apple">Apple</SelectItem>
<SelectItem value="banana">Banana</SelectItem>
<SelectItem value="cherry">Cherry</SelectItem>
</SelectGroup>
<SelectSeparator />
<SelectGroup>
<SelectLabel>Vegetables</SelectLabel>
<SelectItem value="carrot">Carrot</SelectItem>
<SelectItem value="broccoli">Broccoli</SelectItem>
<SelectItem value="spinach">Spinach</SelectItem>
</SelectGroup>
<SelectSeparator />
<SelectGroup>
<SelectLabel>Grains</SelectLabel>
<SelectItem value="rice">Rice</SelectItem>
<SelectItem value="wheat">Wheat</SelectItem>
<SelectItem value="oats">Oats</SelectItem>
</SelectGroup>
</SelectContent>
</Select>
`,
}),
}
Disabled
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import {
Select,
SelectContent,
SelectGroup,
SelectItem,
SelectLabel,
SelectSeparator,
SelectTrigger,
SelectValue,
} from '.'
import { Label } from '../label'
{
name: 'Disabled',
render: () => ({
components: {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
},
template: `
<Select disabled>
<SelectTrigger class="w-[280px]">
<SelectValue placeholder="Select a fruit..." />
</SelectTrigger>
<SelectContent>
<SelectItem value="apple">Apple</SelectItem>
<SelectItem value="banana">Banana</SelectItem>
<SelectItem value="cherry">Cherry</SelectItem>
</SelectContent>
</Select>
`,
}),
}
SelectItemText
import { SelectItemText } from '@gxp-dev/app-ui'
Props
| Name | Type | Required / default | Description |
|---|---|---|---|
asChild | boolean | 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. |
as | AsTag | Component | undefined | — | The element or component this component should render as. Can be overwritten by asChild. |
Slots
| Name | Type | Required / default | Description |
|---|---|---|---|
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 { Select, SelectTrigger, SelectValue, SelectContent, SelectItem, SelectItemText, SelectScrollUpButton, SelectScrollDownButton } from './index'
{ render: () => ({ components: { Select, SelectTrigger, SelectValue, SelectContent, SelectItem, SelectItemText, SelectScrollUpButton, SelectScrollDownButton }, template: `<Select><SelectTrigger class="w-48"><SelectValue placeholder="Choose a team" /></SelectTrigger><SelectContent>
<template #scroll-up><SelectScrollUpButton /></template><template #scroll-down><SelectScrollDownButton /></template>
<SelectItem value="design"><template #text><SelectItemText>Design team</SelectItemText></template></SelectItem><SelectItem value="engineering">Engineering team</SelectItem>
</SelectContent></Select>` }) }
SelectLabel
import { SelectLabel } from '@gxp-dev/app-ui'
Props
| Name | Type | Required / default | Description |
|---|---|---|---|
for | string | undefined | — | — |
asChild | boolean | 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. |
as | AsTag | Component | undefined | — | The element or component this component should render as. Can be overwritten by asChild. |
Slots
| Name | Type | Required / default | Description |
|---|---|---|---|
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.
WithGroups
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import {
Select,
SelectContent,
SelectGroup,
SelectItem,
SelectLabel,
SelectSeparator,
SelectTrigger,
SelectValue,
} from '.'
import { Label } from '../label'
{
name: 'With Groups',
render: () => ({
components: {
Select,
SelectContent,
SelectGroup,
SelectItem,
SelectLabel,
SelectSeparator,
SelectTrigger,
SelectValue,
},
template: `
<Select>
<SelectTrigger class="w-[280px]">
<SelectValue placeholder="Select a food..." />
</SelectTrigger>
<SelectContent>
<SelectGroup>
<SelectLabel>Fruits</SelectLabel>
<SelectItem value="apple">Apple</SelectItem>
<SelectItem value="banana">Banana</SelectItem>
<SelectItem value="cherry">Cherry</SelectItem>
</SelectGroup>
<SelectSeparator />
<SelectGroup>
<SelectLabel>Vegetables</SelectLabel>
<SelectItem value="carrot">Carrot</SelectItem>
<SelectItem value="broccoli">Broccoli</SelectItem>
<SelectItem value="spinach">Spinach</SelectItem>
</SelectGroup>
<SelectSeparator />
<SelectGroup>
<SelectLabel>Grains</SelectLabel>
<SelectItem value="rice">Rice</SelectItem>
<SelectItem value="wheat">Wheat</SelectItem>
<SelectItem value="oats">Oats</SelectItem>
</SelectGroup>
</SelectContent>
</Select>
`,
}),
}
Showcase
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import {
Select,
SelectContent,
SelectGroup,
SelectItem,
SelectLabel,
SelectSeparator,
SelectTrigger,
SelectValue,
} from '.'
import { Label } from '../label'
{
name: 'Showcase',
render: () => ({
components: {
Select,
SelectContent,
SelectGroup,
SelectItem,
SelectLabel,
SelectSeparator,
SelectTrigger,
SelectValue,
Label,
},
template: `
<div class="space-y-8">
<div>
<h3 class="text-lg font-semibold mb-4 text-white">Basic Select</h3>
<div class="grid w-full max-w-sm items-center gap-1.5">
<Label for="fruit">Favorite Fruit</Label>
<Select>
<SelectTrigger id="fruit" class="w-[280px]">
<SelectValue placeholder="Select a fruit..." />
</SelectTrigger>
<SelectContent>
<SelectItem value="apple">Apple</SelectItem>
<SelectItem value="banana">Banana</SelectItem>
<SelectItem value="cherry">Cherry</SelectItem>
<SelectItem value="grape">Grape</SelectItem>
<SelectItem value="orange">Orange</SelectItem>
</SelectContent>
</Select>
</div>
</div>
<div>
<h3 class="text-lg font-semibold mb-4 text-white">Grouped Select</h3>
<div class="grid w-full max-w-sm items-center gap-1.5">
<Label for="timezone">Timezone</Label>
<Select>
<SelectTrigger id="timezone" class="w-[280px]">
<SelectValue placeholder="Select a timezone..." />
</SelectTrigger>
<SelectContent>
<SelectGroup>
<SelectLabel>North America</SelectLabel>
<SelectItem value="est">Eastern Standard Time (EST)</SelectItem>
<SelectItem value="cst">Central Standard Time (CST)</SelectItem>
<SelectItem value="mst">Mountain Standard Time (MST)</SelectItem>
<SelectItem value="pst">Pacific Standard Time (PST)</SelectItem>
</SelectGroup>
<SelectSeparator />
<SelectGroup>
<SelectLabel>Europe</SelectLabel>
<SelectItem value="gmt">Greenwich Mean Time (GMT)</SelectItem>
<SelectItem value="cet">Central European Time (CET)</SelectItem>
<SelectItem value="eet">Eastern European Time (EET)</SelectItem>
</SelectGroup>
</SelectContent>
</Select>
</div>
</div>
<div>
<h3 class="text-lg font-semibold mb-4 text-white">Disabled Select</h3>
<div class="grid w-full max-w-sm items-center gap-1.5">
<Label for="disabled">Disabled Field</Label>
<Select disabled>
<SelectTrigger id="disabled" class="w-[280px]">
<SelectValue placeholder="Cannot select..." />
</SelectTrigger>
<SelectContent>
<SelectItem value="option1">Option 1</SelectItem>
<SelectItem value="option2">Option 2</SelectItem>
</SelectContent>
</Select>
</div>
</div>
<div>
<h3 class="text-lg font-semibold mb-4 text-white">Form Layout</h3>
<div class="grid gap-4 max-w-md">
<div class="grid w-full items-center gap-1.5">
<Label for="country">Country</Label>
<Select>
<SelectTrigger id="country">
<SelectValue placeholder="Select your country..." />
</SelectTrigger>
<SelectContent>
<SelectItem value="us">United States</SelectItem>
<SelectItem value="uk">United Kingdom</SelectItem>
<SelectItem value="ca">Canada</SelectItem>
<SelectItem value="au">Australia</SelectItem>
<SelectItem value="de">Germany</SelectItem>
<SelectItem value="fr">France</SelectItem>
</SelectContent>
</Select>
</div>
<div class="grid w-full items-center gap-1.5">
<Label for="language">Preferred Language</Label>
<Select default-value="en">
<SelectTrigger id="language">
<SelectValue placeholder="Select a language..." />
</SelectTrigger>
<SelectContent>
<SelectItem value="en">English</SelectItem>
<SelectItem value="es">Spanish</SelectItem>
<SelectItem value="fr">French</SelectItem>
<SelectItem value="de">German</SelectItem>
<SelectItem value="ja">Japanese</SelectItem>
</SelectContent>
</Select>
</div>
<div class="grid w-full items-center gap-1.5">
<Label for="role">Role</Label>
<Select>
<SelectTrigger id="role">
<SelectValue placeholder="Select a role..." />
</SelectTrigger>
<SelectContent>
<SelectGroup>
<SelectLabel>Engineering</SelectLabel>
<SelectItem value="frontend">Frontend Developer</SelectItem>
<SelectItem value="backend">Backend Developer</SelectItem>
<SelectItem value="fullstack">Fullstack Developer</SelectItem>
</SelectGroup>
<SelectSeparator />
<SelectGroup>
<SelectLabel>Design</SelectLabel>
<SelectItem value="ui">UI Designer</SelectItem>
<SelectItem value="ux">UX Designer</SelectItem>
<SelectItem value="product">Product Designer</SelectItem>
</SelectGroup>
</SelectContent>
</Select>
</div>
</div>
</div>
</div>
`,
}),
}
SelectScrollDownButton
import { SelectScrollDownButton } from '@gxp-dev/app-ui'
Props
| Name | Type | Required / default | Description |
|---|---|---|---|
asChild | boolean | 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. |
as | AsTag | Component | undefined | — | The element or component this component should render as. Can be overwritten by asChild. |
Slots
| Name | Type | Required / default | Description |
|---|---|---|---|
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 { Select, SelectTrigger, SelectValue, SelectContent, SelectItem, SelectItemText, SelectScrollUpButton, SelectScrollDownButton } from './index'
{ render: () => ({ components: { Select, SelectTrigger, SelectValue, SelectContent, SelectItem, SelectItemText, SelectScrollUpButton, SelectScrollDownButton }, template: `<Select><SelectTrigger class="w-48"><SelectValue placeholder="Choose a team" /></SelectTrigger><SelectContent>
<template #scroll-up><SelectScrollUpButton /></template><template #scroll-down><SelectScrollDownButton /></template>
<SelectItem value="design"><template #text><SelectItemText>Design team</SelectItemText></template></SelectItem><SelectItem value="engineering">Engineering team</SelectItem>
</SelectContent></Select>` }) }
SelectScrollUpButton
import { SelectScrollUpButton } from '@gxp-dev/app-ui'
Props
| Name | Type | Required / default | Description |
|---|---|---|---|
asChild | boolean | 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. |
as | AsTag | Component | undefined | — | The element or component this component should render as. Can be overwritten by asChild. |
Slots
| Name | Type | Required / default | Description |
|---|---|---|---|
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 { Select, SelectTrigger, SelectValue, SelectContent, SelectItem, SelectItemText, SelectScrollUpButton, SelectScrollDownButton } from './index'
{ render: () => ({ components: { Select, SelectTrigger, SelectValue, SelectContent, SelectItem, SelectItemText, SelectScrollUpButton, SelectScrollDownButton }, template: `<Select><SelectTrigger class="w-48"><SelectValue placeholder="Choose a team" /></SelectTrigger><SelectContent>
<template #scroll-up><SelectScrollUpButton /></template><template #scroll-down><SelectScrollDownButton /></template>
<SelectItem value="design"><template #text><SelectItemText>Design team</SelectItemText></template></SelectItem><SelectItem value="engineering">Engineering team</SelectItem>
</SelectContent></Select>` }) }
SelectSeparator
import { SelectSeparator } from '@gxp-dev/app-ui'
Props
| Name | Type | Required / default | Description |
|---|---|---|---|
asChild | boolean | 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. |
as | AsTag | Component | undefined | — | The element or component this component should render as. Can be overwritten by asChild. |
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.
WithGroups
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import {
Select,
SelectContent,
SelectGroup,
SelectItem,
SelectLabel,
SelectSeparator,
SelectTrigger,
SelectValue,
} from '.'
import { Label } from '../label'
{
name: 'With Groups',
render: () => ({
components: {
Select,
SelectContent,
SelectGroup,
SelectItem,
SelectLabel,
SelectSeparator,
SelectTrigger,
SelectValue,
},
template: `
<Select>
<SelectTrigger class="w-[280px]">
<SelectValue placeholder="Select a food..." />
</SelectTrigger>
<SelectContent>
<SelectGroup>
<SelectLabel>Fruits</SelectLabel>
<SelectItem value="apple">Apple</SelectItem>
<SelectItem value="banana">Banana</SelectItem>
<SelectItem value="cherry">Cherry</SelectItem>
</SelectGroup>
<SelectSeparator />
<SelectGroup>
<SelectLabel>Vegetables</SelectLabel>
<SelectItem value="carrot">Carrot</SelectItem>
<SelectItem value="broccoli">Broccoli</SelectItem>
<SelectItem value="spinach">Spinach</SelectItem>
</SelectGroup>
<SelectSeparator />
<SelectGroup>
<SelectLabel>Grains</SelectLabel>
<SelectItem value="rice">Rice</SelectItem>
<SelectItem value="wheat">Wheat</SelectItem>
<SelectItem value="oats">Oats</SelectItem>
</SelectGroup>
</SelectContent>
</Select>
`,
}),
}
Showcase
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import {
Select,
SelectContent,
SelectGroup,
SelectItem,
SelectLabel,
SelectSeparator,
SelectTrigger,
SelectValue,
} from '.'
import { Label } from '../label'
{
name: 'Showcase',
render: () => ({
components: {
Select,
SelectContent,
SelectGroup,
SelectItem,
SelectLabel,
SelectSeparator,
SelectTrigger,
SelectValue,
Label,
},
template: `
<div class="space-y-8">
<div>
<h3 class="text-lg font-semibold mb-4 text-white">Basic Select</h3>
<div class="grid w-full max-w-sm items-center gap-1.5">
<Label for="fruit">Favorite Fruit</Label>
<Select>
<SelectTrigger id="fruit" class="w-[280px]">
<SelectValue placeholder="Select a fruit..." />
</SelectTrigger>
<SelectContent>
<SelectItem value="apple">Apple</SelectItem>
<SelectItem value="banana">Banana</SelectItem>
<SelectItem value="cherry">Cherry</SelectItem>
<SelectItem value="grape">Grape</SelectItem>
<SelectItem value="orange">Orange</SelectItem>
</SelectContent>
</Select>
</div>
</div>
<div>
<h3 class="text-lg font-semibold mb-4 text-white">Grouped Select</h3>
<div class="grid w-full max-w-sm items-center gap-1.5">
<Label for="timezone">Timezone</Label>
<Select>
<SelectTrigger id="timezone" class="w-[280px]">
<SelectValue placeholder="Select a timezone..." />
</SelectTrigger>
<SelectContent>
<SelectGroup>
<SelectLabel>North America</SelectLabel>
<SelectItem value="est">Eastern Standard Time (EST)</SelectItem>
<SelectItem value="cst">Central Standard Time (CST)</SelectItem>
<SelectItem value="mst">Mountain Standard Time (MST)</SelectItem>
<SelectItem value="pst">Pacific Standard Time (PST)</SelectItem>
</SelectGroup>
<SelectSeparator />
<SelectGroup>
<SelectLabel>Europe</SelectLabel>
<SelectItem value="gmt">Greenwich Mean Time (GMT)</SelectItem>
<SelectItem value="cet">Central European Time (CET)</SelectItem>
<SelectItem value="eet">Eastern European Time (EET)</SelectItem>
</SelectGroup>
</SelectContent>
</Select>
</div>
</div>
<div>
<h3 class="text-lg font-semibold mb-4 text-white">Disabled Select</h3>
<div class="grid w-full max-w-sm items-center gap-1.5">
<Label for="disabled">Disabled Field</Label>
<Select disabled>
<SelectTrigger id="disabled" class="w-[280px]">
<SelectValue placeholder="Cannot select..." />
</SelectTrigger>
<SelectContent>
<SelectItem value="option1">Option 1</SelectItem>
<SelectItem value="option2">Option 2</SelectItem>
</SelectContent>
</Select>
</div>
</div>
<div>
<h3 class="text-lg font-semibold mb-4 text-white">Form Layout</h3>
<div class="grid gap-4 max-w-md">
<div class="grid w-full items-center gap-1.5">
<Label for="country">Country</Label>
<Select>
<SelectTrigger id="country">
<SelectValue placeholder="Select your country..." />
</SelectTrigger>
<SelectContent>
<SelectItem value="us">United States</SelectItem>
<SelectItem value="uk">United Kingdom</SelectItem>
<SelectItem value="ca">Canada</SelectItem>
<SelectItem value="au">Australia</SelectItem>
<SelectItem value="de">Germany</SelectItem>
<SelectItem value="fr">France</SelectItem>
</SelectContent>
</Select>
</div>
<div class="grid w-full items-center gap-1.5">
<Label for="language">Preferred Language</Label>
<Select default-value="en">
<SelectTrigger id="language">
<SelectValue placeholder="Select a language..." />
</SelectTrigger>
<SelectContent>
<SelectItem value="en">English</SelectItem>
<SelectItem value="es">Spanish</SelectItem>
<SelectItem value="fr">French</SelectItem>
<SelectItem value="de">German</SelectItem>
<SelectItem value="ja">Japanese</SelectItem>
</SelectContent>
</Select>
</div>
<div class="grid w-full items-center gap-1.5">
<Label for="role">Role</Label>
<Select>
<SelectTrigger id="role">
<SelectValue placeholder="Select a role..." />
</SelectTrigger>
<SelectContent>
<SelectGroup>
<SelectLabel>Engineering</SelectLabel>
<SelectItem value="frontend">Frontend Developer</SelectItem>
<SelectItem value="backend">Backend Developer</SelectItem>
<SelectItem value="fullstack">Fullstack Developer</SelectItem>
</SelectGroup>
<SelectSeparator />
<SelectGroup>
<SelectLabel>Design</SelectLabel>
<SelectItem value="ui">UI Designer</SelectItem>
<SelectItem value="ux">UX Designer</SelectItem>
<SelectItem value="product">Product Designer</SelectItem>
</SelectGroup>
</SelectContent>
</Select>
</div>
</div>
</div>
</div>
`,
}),
}
SelectTrigger
import { SelectTrigger } from '@gxp-dev/app-ui'
Props
| Name | Type | Required / default | Description |
|---|---|---|---|
disabled | boolean | undefined | — | — |
reference | ReferenceElement | undefined | — | The reference (or anchor) element that is being referred to for positioning. If not provided will use the current component as anchor. |
asChild | boolean | 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. |
as | AsTag | Component | undefined | — | The element or component this component should render as. Can be overwritten by asChild. |
Slots
| Name | Type | Required / default | Description |
|---|---|---|---|
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.
Default
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import {
Select,
SelectContent,
SelectGroup,
SelectItem,
SelectLabel,
SelectSeparator,
SelectTrigger,
SelectValue,
} from '.'
import { Label } from '../label'
{
render: () => ({
components: {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
},
template: `
<Select>
<SelectTrigger class="w-[280px]">
<SelectValue placeholder="Select a fruit..." />
</SelectTrigger>
<SelectContent>
<SelectItem value="apple">Apple</SelectItem>
<SelectItem value="banana">Banana</SelectItem>
<SelectItem value="cherry">Cherry</SelectItem>
<SelectItem value="grape">Grape</SelectItem>
<SelectItem value="orange">Orange</SelectItem>
</SelectContent>
</Select>
`,
}),
}
WithGroups
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import {
Select,
SelectContent,
SelectGroup,
SelectItem,
SelectLabel,
SelectSeparator,
SelectTrigger,
SelectValue,
} from '.'
import { Label } from '../label'
{
name: 'With Groups',
render: () => ({
components: {
Select,
SelectContent,
SelectGroup,
SelectItem,
SelectLabel,
SelectSeparator,
SelectTrigger,
SelectValue,
},
template: `
<Select>
<SelectTrigger class="w-[280px]">
<SelectValue placeholder="Select a food..." />
</SelectTrigger>
<SelectContent>
<SelectGroup>
<SelectLabel>Fruits</SelectLabel>
<SelectItem value="apple">Apple</SelectItem>
<SelectItem value="banana">Banana</SelectItem>
<SelectItem value="cherry">Cherry</SelectItem>
</SelectGroup>
<SelectSeparator />
<SelectGroup>
<SelectLabel>Vegetables</SelectLabel>
<SelectItem value="carrot">Carrot</SelectItem>
<SelectItem value="broccoli">Broccoli</SelectItem>
<SelectItem value="spinach">Spinach</SelectItem>
</SelectGroup>
<SelectSeparator />
<SelectGroup>
<SelectLabel>Grains</SelectLabel>
<SelectItem value="rice">Rice</SelectItem>
<SelectItem value="wheat">Wheat</SelectItem>
<SelectItem value="oats">Oats</SelectItem>
</SelectGroup>
</SelectContent>
</Select>
`,
}),
}
Disabled
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import {
Select,
SelectContent,
SelectGroup,
SelectItem,
SelectLabel,
SelectSeparator,
SelectTrigger,
SelectValue,
} from '.'
import { Label } from '../label'
{
name: 'Disabled',
render: () => ({
components: {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
},
template: `
<Select disabled>
<SelectTrigger class="w-[280px]">
<SelectValue placeholder="Select a fruit..." />
</SelectTrigger>
<SelectContent>
<SelectItem value="apple">Apple</SelectItem>
<SelectItem value="banana">Banana</SelectItem>
<SelectItem value="cherry">Cherry</SelectItem>
</SelectContent>
</Select>
`,
}),
}
SelectValue
import { SelectValue } from '@gxp-dev/app-ui'
Props
| Name | Type | Required / default | Description |
|---|---|---|---|
placeholder | string | undefined | — | The content that will be rendered inside the SelectValue when no value or defaultValue is set. |
asChild | boolean | 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. |
as | AsTag | Component | undefined | — | The element or component this component should render as. Can be overwritten by asChild. |
Slots
| Name | Type | Required / default | Description |
|---|---|---|---|
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.
Default
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import {
Select,
SelectContent,
SelectGroup,
SelectItem,
SelectLabel,
SelectSeparator,
SelectTrigger,
SelectValue,
} from '.'
import { Label } from '../label'
{
render: () => ({
components: {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
},
template: `
<Select>
<SelectTrigger class="w-[280px]">
<SelectValue placeholder="Select a fruit..." />
</SelectTrigger>
<SelectContent>
<SelectItem value="apple">Apple</SelectItem>
<SelectItem value="banana">Banana</SelectItem>
<SelectItem value="cherry">Cherry</SelectItem>
<SelectItem value="grape">Grape</SelectItem>
<SelectItem value="orange">Orange</SelectItem>
</SelectContent>
</Select>
`,
}),
}
WithGroups
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import {
Select,
SelectContent,
SelectGroup,
SelectItem,
SelectLabel,
SelectSeparator,
SelectTrigger,
SelectValue,
} from '.'
import { Label } from '../label'
{
name: 'With Groups',
render: () => ({
components: {
Select,
SelectContent,
SelectGroup,
SelectItem,
SelectLabel,
SelectSeparator,
SelectTrigger,
SelectValue,
},
template: `
<Select>
<SelectTrigger class="w-[280px]">
<SelectValue placeholder="Select a food..." />
</SelectTrigger>
<SelectContent>
<SelectGroup>
<SelectLabel>Fruits</SelectLabel>
<SelectItem value="apple">Apple</SelectItem>
<SelectItem value="banana">Banana</SelectItem>
<SelectItem value="cherry">Cherry</SelectItem>
</SelectGroup>
<SelectSeparator />
<SelectGroup>
<SelectLabel>Vegetables</SelectLabel>
<SelectItem value="carrot">Carrot</SelectItem>
<SelectItem value="broccoli">Broccoli</SelectItem>
<SelectItem value="spinach">Spinach</SelectItem>
</SelectGroup>
<SelectSeparator />
<SelectGroup>
<SelectLabel>Grains</SelectLabel>
<SelectItem value="rice">Rice</SelectItem>
<SelectItem value="wheat">Wheat</SelectItem>
<SelectItem value="oats">Oats</SelectItem>
</SelectGroup>
</SelectContent>
</Select>
`,
}),
}
Disabled
import type { Meta, StoryObj } from '@storybook/vue3-vite'
import {
Select,
SelectContent,
SelectGroup,
SelectItem,
SelectLabel,
SelectSeparator,
SelectTrigger,
SelectValue,
} from '.'
import { Label } from '../label'
{
name: 'Disabled',
render: () => ({
components: {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
},
template: `
<Select disabled>
<SelectTrigger class="w-[280px]">
<SelectValue placeholder="Select a fruit..." />
</SelectTrigger>
<SelectContent>
<SelectItem value="apple">Apple</SelectItem>
<SelectItem value="banana">Banana</SelectItem>
<SelectItem value="cherry">Cherry</SelectItem>
</SelectContent>
</Select>
`,
}),
}