Select
Features
- Can be controlled or uncontrolled.
- Offers 2 positioning modes.
- Supports items, labels, groups of items.
- Focus is fully managed.
- Full keyboard navigation.
- Supports custom placeholder.
- Typeahead support.
- Supports Right to Left direction.
Installation
Install the component from your command line.
$ npm add reka-uiAnatomy
Import all parts and piece them together.
<script setup lang="ts">
import {
SelectContent,
SelectGroup,
SelectIcon,
SelectItem,
SelectItemIndicator,
SelectLabel,
SelectPortal,
SelectRoot,
SelectScrollDownButton,
SelectScrollUpButton,
SelectSeparator,
SelectTrigger,
SelectValue,
SelectViewport,
SelectVirtualizer,
} from 'reka-ui'
</script>
<template>
<SelectRoot>
<SelectTrigger>
<SelectValue />
<SelectIcon />
</SelectTrigger>
<SelectPortal>
<SelectContent>
<SelectScrollUpButton />
<SelectViewport>
<SelectItem>
<SelectItemText />
<SelectItemIndicator />
</SelectItem>
<SelectGroup>
<SelectLabel />
<SelectItem>
<SelectItemText />
<SelectItemIndicator />
</SelectItem>
</SelectGroup>
<SelectSeparator />
<!-- or with virtual -->
<SelectVirtualizer>
<SelectItem />
</SelectVirtualizer>
</SelectViewport>
<SelectScrollDownButton />
<SelectArrow />
</SelectContent>
</SelectPortal>
</SelectRoot>
</template>API Reference
Root
Contains all the parts of a Select
Trigger
The button that toggles the Select The SelectContent will position itself by aligning over the trigger.
| Data Attribute | Value |
|---|---|
[data-state] | "open" | "closed" |
[data-disabled] | Present when disabled |
[data-placeholder] | Present when has placeholder |
Value
The part that reflects the selected value. By default the selected item's text will be rendered. if you require more control, you can instead control the select and pass your own children. It should not be styled to ensure correct positioning. An optional placeholder prop is also available for when the select has no value.
Icon
A small icon often displayed next to the value as a visual affordance for the fact it can be open. By default renders ▼ but you can use your own icon via asChild or use children.
Portal
When used, portals the content part into the body.
Content
The component that pops out when the select is open.
| Data Attribute | Value |
|---|---|
[data-state] | "open" | "closed" |
[data-side] | "left" | "right" | "bottom" | "top" |
[data-align] | "start" | "end" | "center" |
| CSS Variable | Description |
|---|---|
--reka-select-content-transform-origin | The transform-origin computed from the content and arrow positions/offsets. Only present when position="popper". |
--reka-select-content-available-width | The remaining width between the trigger and the boundary edge. Only present when position="popper". |
--reka-select-content-available-height | The remaining height between the trigger and the boundary edge. Only present when position="popper". |
--reka-select-trigger-width | The width of the trigger. Only present when position="popper". |
--reka-select-trigger-height | The height of the trigger. Only present when position="popper". |
Viewport
The scrolling viewport that contains all of the items.
Virtualizer
Virtual container to achieve list virtualization. Only supported with position="popper" on the content.
Item
The component that contains the select items.
| Data Attribute | Value |
|---|---|
[data-state] | "checked" | "unchecked" |
[data-highlighted] | Present when highlighted |
[data-disabled] | Present when disabled |
ItemText
The textual part of the item. It should only contain the text you want to see in the trigger when that item is selected. It should not be styled to ensure correct positioning.
ItemIndicator
Renders when the item is selected. You can style this element directly, or you can use it as a wrapper to put an icon into, or both.
ScrollUpButton
An optional button used as an affordance to show the viewport overflow as well as functionally enable scrolling upwards.
ScrollDownButton
An optional button used as an affordance to show the viewport overflow as well as functionally enable scrolling downwards.
Group
Used to group multiple items. use in conjunction with SelectLabel to ensure good accessibility via automatic labelling.
Label
Used to render the label of a group. It won't be focusable using arrow keys.
Separator
Used to visually separate items in the Select
Arrow
An optional arrow element to render alongside the content. This can be used to help visually link the trigger with the SelectContent. Must be rendered inside SelectContent. Only available when position is set to popper.
Examples
Change the positioning mode
By default, Select will behave similarly to a native MacOS menu by positioning SelectContent relative to the active item. If you would prefer an alternative positioning approach similar to Popover or DropdownMenu then you can set position to popper and make use of additional alignment options such as side, sideOffset and more.
// index.vue
<script setup lang="ts">
import {
SelectContent,
SelectGroup,
SelectItem,
SelectItemIndicator,
SelectLabel,
SelectPortal,
SelectRoot,
SelectSeparator,
SelectTrigger,
} from 'reka-ui'
</script>
<template>
<SelectRoot>
<SelectTrigger>…</SelectTrigger>
<SelectPortal>
<SelectContent
position="popper"
:side-offset="5"
>
…
</SelectContent>
</SelectPortal>
</SelectRoot>
</template>Constrain the content size
When using position="popper" on SelectContent, you may want to constrain the width of the content so that it matches the trigger width. You may also want to constrain its height to not exceed the viewport.
We expose several CSS custom properties such as --reka-select-trigger-width and --reka-select-content-available-height to support this. Use them to constrain the content dimensions.
// index.vue
<script setup lang="ts">
import {
SelectContent,
SelectGroup,
SelectItem,
SelectItemIndicator,
SelectLabel,
SelectPortal,
SelectRoot,
SelectSeparator,
SelectTrigger,
} from 'reka-ui'
</script>
<template>
<SelectRoot>
<SelectTrigger>…</SelectTrigger>
<SelectPortal>
<SelectContent
class="SelectContent"
position="popper"
:side-offset="5"
>
…
</SelectContent>
</SelectPortal>
</SelectRoot>
</template>/* styles.css */
.SelectContent {
width: var(--reka-select-trigger-width);
max-height: var(--reka-select-content-available-height);
}With disabled items
You can add special styles to disabled items via the data-disabled attribute.
// index.vue
<script setup lang="ts">
import {
SelectContent,
SelectGroup,
SelectItem,
SelectItemIndicator,
SelectLabel,
SelectPortal,
SelectRoot,
SelectSeparator,
SelectTrigger,
} from 'reka-ui'
</script>
<template>
<SelectRoot>
<SelectTrigger>…</SelectTrigger>
<SelectPortal>
<SelectContent>
<SelectViewport>
<SelectItem
class="SelectItem"
disabled
>
…
</SelectItem>
<SelectItem>…</SelectItem>
<SelectItem>…</SelectItem>
</SelectViewport>
</SelectContent>
</SelectPortal>
</SelectRoot>
</template>/* styles.css */
.SelectItem[data-disabled] {
color: "gainsboro";
}With a placeholder
You can use the placeholder prop on Value for when the select has no value. There's also a data-placeholder attribute on Trigger to help with styling.
// index.vue
<script setup lang="ts">
import {
SelectContent,
SelectGroup,
SelectItem,
SelectItemIndicator,
SelectLabel,
SelectPortal,
SelectRoot,
SelectSeparator,
SelectTrigger,
} from 'reka-ui'
import './styles.css'
</script>
<template>
<SelectRoot>
<SelectTrigger class="SelectTrigger">
<SelectValue placeholder="Pick an option" />
<SelectIcon />
</SelectTrigger>
<SelectPortal>
<SelectContent>…</SelectContent>
</SelectPortal>
</SelectRoot>
</template>/* styles.css */
.SelectTrigger[data-placeholder] {
color: "gainsboro";
}With separators
Use the Separator part to add a separator between items.
<template>
<SelectRoot>
<SelectTrigger>…</SelectTrigger>
<SelectPortal>
<SelectContent>
<SelectViewport>
<SelectItem>…</SelectItem>
<SelectItem>…</SelectItem>
<SelectItem>…</SelectItem>
<SelectSeparator />
<SelectItem>…</SelectItem>
<SelectItem>…</SelectItem>
</SelectViewport>
</SelectContent>
</SelectPortal>
</SelectRoot>
</template>With grouped items
Use the Group and Label parts to group items in a section.
<template>
<SelectRoot>
<SelectTrigger>…</SelectTrigger>
<SelectPortal>
<SelectContent>
<SelectViewport>
<SelectGroup>
<SelectLabel>Label</SelectLabel>
<SelectItem>…</SelectItem>
<SelectItem>…</SelectItem>
<SelectItem>…</SelectItem>
</SelectGroup>
</SelectViewport>
</SelectContent>
</SelectPortal>
</SelectRoot>
</template>With complex items
You can use custom content in your items.
<script setup lang="ts">
import {
SelectContent,
SelectGroup,
SelectItem,
SelectItemIndicator,
SelectLabel,
SelectPortal,
SelectRoot,
SelectSeparator,
SelectTrigger,
} from 'reka-ui'
</script>
<template>
<SelectRoot>
<SelectTrigger>…</SelectTrigger>
<SelectPortal>
<SelectContent>
<SelectViewport>
<SelectItem>
<SelectItemText>
<img src="…">
Adolfo Hess
</SelectItemText>
<SelectItemIndicator>…</SelectItemIndicator>
</SelectItem>
<SelectItem>…</SelectItem> <SelectItem>…</SelectItem>
</SelectViewport>
</SelectContent>
</SelectPortal>
</SelectRoot>
</template>Controlling the value displayed in the trigger
By default the trigger display the selected item's text (no longer automatically render ItemText's content like in v1).
If you need to render other than plain text, you can control the component using v-model props (or accessing SelectValue's slotProps) and passing slot to SelectValue. Remember to make sure what you put in there is accessible.
<script setup>
const countries = { 'france': '🇫🇷', 'united-kingdom': '🇬🇧', 'spain': '🇪🇸' }
const value = ref('france')
</script>
<template>
<SelectRoot v-model="value">
<SelectTrigger>
<SelectValue :aria-label="value">
{{ countries[value] }}
</SelectValue>
<SelectIcon />
</SelectTrigger>
<SelectPortal>
<SelectContent>
<SelectViewport>
<SelectItem value="france">
<SelectItemText>France</SelectItemText>
<SelectItemIndicator>…</SelectItemIndicator>
</SelectItem>
<SelectItem value="united-kingdom">
<SelectItemText>United Kingdom</SelectItemText>
<SelectItemIndicator>…</SelectItemIndicator>
</SelectItem>
<SelectItem value="spain">
<SelectItemText>Spain</SelectItemText>
<SelectItemIndicator>…</SelectItemIndicator>
</SelectItem>
</SelectViewport>
</SelectContent>
</SelectPortal>
</SelectRoot>
</template>Showing the value before the content renders
SelectValue shows the text of the selected item's SelectItemText. The texts are remembered once an item has rendered, also after it unmounts. A closed select renders its items out of the page, in a lightweight form, only while something needs their texts: a selected value, a typed character on the closed trigger, or the hidden native <select> of a named select in a form, which holds its options from the mount so autofill can reach them. Focusing the trigger renders nothing, so tabbing through a form costs no render. While rendered they stay live, in document order, so a translated text, a refetched list or a disabled change shows while the select is closed. When focus leaves the trigger and nothing else needs them, they unmount again.
To resolve a selected value without that render, describe the options with items (see Listing the items as data), or pass display-value to the root to resolve the selected value's text yourself (object values, items loaded on open). With display-value and no items, until the content has been opened once the hidden native <select> only holds the selected values, so browser autofill cannot pick another one, and typing on the closed trigger has no items to match.
<template>
<SelectRoot
v-model="user"
by="id"
:display-value="(user) => user.name"
>
<SelectTrigger>
<SelectValue placeholder="Pick a user" />
</SelectTrigger>
<!-- ... -->
</SelectRoot>
</template>Listing the items as data
Pass the options to items as well as rendering them. The trigger, the typeahead on the closed trigger and the hidden native <select> then read the labels from items, so a closed select needs no items rendered to show its value. It takes the same shapes as Base UI: a record of value to label, an array of { value, label, disabled? }, or an array of groups { label?, items }. An item's label is the text the trigger shows and the typeahead matches; it wins over the item's SelectItemText, and the items are still rendered by your template.
A typed character tries items first and renders nothing when that answers it, as when it jumps to another letter. It renders the items, until focus leaves the trigger, when:
- nothing in
itemsmatches, or repeating a key wraps past its last match. This keeps an option only aSelectItemhas reachable. Only the render can rule such an option out, so a wrap renders even whenitemslists every option; - the match is in a record and no item has rendered for it, because the item's own value may not be a string;
- the match depends on a remembered
disabled(below).
With a name in a form, the items render in idle time, for the native <select>.
While the items aren't rendered, disabled comes only from items. A disabled set only on a SelectItem lives in your template, so it can't be known without the render items avoids: any typed character that items answers can select that option, not only the first one, and its native option stays enabled until the items render. Set disabled in items as well if your template sets it.
Once an item has rendered, its own disabled counts, and follows your template while it stays rendered. After it unmounts, its last disabled is remembered:
- A typed character whose match depends on it renders the items to check, so an option re-enabled while closed is found. If the template no longer renders that option, only
disabledinitemscounts. - The native option keeps the remembered value until the item renders again.
- With
display-value, which never renders closed items, the typeahead uses the remembered value too.
When items lists only some of your options, or in a different order from your template, the order of the typeahead can change once the items render. Before the render a key cycles through items in its own order. After it, rendered items come first in template order, followed by options only items lists. So a key can select a listed option ahead of one only a SelectItem has, and a cycle can change order midway. List every option, in template order, to avoid this.
<script setup lang="ts">
const fruits = [
{ value: 'apple', label: 'Apple' },
{ value: 'banana', label: 'Banana' },
{ value: 'grapes', label: 'Grapes', disabled: true },
]
</script>
<template>
<SelectRoot :items="fruits">
<SelectTrigger>
<SelectValue placeholder="Pick a fruit" />
</SelectTrigger>
<SelectPortal>
<SelectContent>
<SelectViewport>
<SelectItem
v-for="fruit in fruits"
:key="fruit.value"
:value="fruit.value"
:disabled="fruit.disabled"
>
<SelectItemText>{{ fruit.label }}</SelectItemText>
</SelectItem>
</SelectViewport>
</SelectContent>
</SelectPortal>
</SelectRoot>
</template>Object values work with by: { value: user, label: user.name }. A record's keys are strings: a number value finds its label by its string form, and the typeahead and the native <select> write the matching SelectItem's own value once it has rendered. An option only the record lists, or an autofill that arrives before the idle render, writes its string key. While unrendered, a record's typed value is the one last registered, so a template that changes 1 to '1' meanwhile still writes 1. Use the array shape for values that are not strings.
Selecting multiple values
With multiple, an item press toggles its value and the content stays open. v-model and update:modelValue are typed T[]. SelectValue joins the selected texts with , , and its slot receives them as selectedLabels. With a name, every selected value is submitted with the form.
<template>
<SelectRoot
v-model="fruits"
multiple
name="fruits"
>
<SelectTrigger>
<SelectValue placeholder="Pick fruits" />
</SelectTrigger>
<!-- ... -->
</SelectRoot>
</template>Reacting to changes
update:modelValue and update:open receive a second argument with the reason for the change and the native event. beforeUpdate:modelValue and beforeUpdate:open fire first, and details.cancel() keeps the current state. Cancelling the value of an item press keeps the content open. The reasons are exported as SelectChangeReason ('item-press' | 'item-keydown' | 'typeahead' | 'autofill') and SelectOpenChangeReason ('trigger-press' | 'list-navigation' | 'item-press' | 'item-keydown' | 'escape-key' | 'outside-press'), plus 'imperative-action' for programmatic changes. Pressing the selected item of a single select emits nothing and closes the content, also when by matches a different object. In popper position the trigger stays clickable above the backdrop, and pressing it closes the content ('trigger-press').
<template>
<SelectRoot
v-model="plan"
@before-update:model-value="(value, details) => {
// ignore browser autofill
if (details.reason === 'autofill')
details.cancel()
}"
>
<!-- ... -->
</SelectRoot>
</template>Loading options on open
Fetch the options the first time the content opens, from update:open. The selected value usually arrives earlier, with the page, so describe how to label it without the options: an object value with by and display-value shows its own name in the trigger, and matches the fetched object with the same id once the options render.
In a form
Inside a FieldRoot, the select takes the field's name, required and disabled, gets labelled by FieldLabel, and is missing (valueMissing) while nothing is selected. Inside a FormRoot, its value is part of the values passed to formSubmit. See Forms and validation.
<template>
<FormRoot @form-submit="(values) => save(values.country)">
<FieldRoot name="country" required>
<FieldLabel>Country</FieldLabel>
<SelectRoot>
<SelectTrigger>
<SelectValue placeholder="Select a country" />
</SelectTrigger>
<!-- ... -->
</SelectRoot>
<FieldError match="valueMissing">
Select your country.
</FieldError>
</FieldRoot>
<button type="submit">
Save
</button>
</FormRoot>
</template>Without a Field, give the root a name (and required if needed): inside any form it renders a hidden native <select>, so the browser submits the value and autofill can fill it.
Virtualized
For a long list (thousands of options), render the items through a SelectVirtualizer inside the SelectViewport: only the visible window of options is mounted. Each option is the value of the SelectItem it renders, and text-content gives its text for typeahead (needed for object options; a string option is its own text). The virtualizer also renders the selected options while the content is closed, so their SelectItemText shows in SelectValue even when the selected item was never scrolled into view, and the keyboard (arrows, Home/End, typeahead) reaches options outside the rendered window. For object options, set a key by (by="id"): a function by compares values one by one, which gets slow with thousands of options.
SelectVirtualizer needs position="popper" and a height on the viewport. With the default item-aligned position it renders every option without virtualization and warns in development, because item-aligned positioning measures the selected item. Options can also be grouped: set grouped, pass { label, options, disabled? } groups and render each header through the group slot. See the virtualization guide.
<script setup lang="ts">
import { SelectContent, SelectItem, SelectItemText, SelectPortal, SelectRoot, SelectTrigger, SelectValue, SelectViewport, SelectVirtualizer } from 'reka-ui'
import { ref } from 'vue'
const countries = ref<string[]>([/* thousands of names */])
const country = ref<string>()
</script>
<template>
<SelectRoot v-model="country">
<SelectTrigger aria-label="Country">
<SelectValue placeholder="Pick a country" />
</SelectTrigger>
<SelectPortal>
<SelectContent position="popper">
<!-- The viewport needs a height -->
<SelectViewport class="max-h-72">
<SelectVirtualizer
v-slot="{ option }"
:options="countries"
:estimate-size="25"
>
<SelectItem :value="option">
<SelectItemText>{{ option }}</SelectItemText>
</SelectItem>
</SelectVirtualizer>
</SelectViewport>
</SelectContent>
</SelectPortal>
</SelectRoot>
</template>Custom keyboard navigation
get-navigation-intent maps a keydown in the content to a move ('first', 'last', 'prev', 'next') or to 'select'. Return undefined to keep the default for the key, or null to ignore it. Returning null for Enter or Space stops them from selecting.
<template>
<SelectRoot
:get-navigation-intent="(event) => {
if (event.ctrlKey && event.key === 'n') return 'next'
if (event.ctrlKey && event.key === 'p') return 'prev'
}"
>
<!-- ... -->
</SelectRoot>
</template>Headless composables
The parts are built on composables you can use on your own elements:
useSelectRoot(): the value and open models, the label registry and the context.useSelectTrigger(),useSelectValue(),useSelectContent(),useSelectItem(),useSelectItemText()anduseSelectItemIndicator(): one per part.
Each part composable returns a surface whose attrs hold the role, aria-* and data-* attributes and the event handlers to bind. Positioning, presence, focus trapping and dismissal are not part of the composables. Compose PopperContent, Presence and DismissableLayer as the components do, or bring your own. These composables are experimental.
With custom scrollbar
The native scrollbar is hidden by default as we recommend using the ScrollUpButton and ScrollDownButton parts for the best UX. If you do not want to use these parts, compose your select with our Scroll Area primitive.
// index.vue
<script setup lang="ts">
import {
ScrollAreaRoot,
ScrollAreaScrollbar,
ScrollAreaThumb,
ScrollAreaViewport,
SelectContent,
SelectGroup,
SelectItem,
SelectItemIndicator,
SelectLabel,
SelectPortal,
SelectRoot,
SelectSeparator,
SelectTrigger,
} from 'reka-ui'
</script>
<template>
<SelectRoot>
<SelectTrigger>…</SelectTrigger>
<SelectPortal>
<SelectContent>
<ScrollAreaRoot
class="ScrollAreaRoot"
type="auto"
>
<SelectViewport as-child>
<ScrollAreaViewport class="ScrollAreaViewport">
<StyledItem>…</StyledItem> <StyledItem>…</StyledItem>
<StyledItem>…</StyledItem>
</ScrollAreaViewport>
</SelectViewport>
<ScrollAreaScrollbar
class="ScrollAreaScrollbar"
orientation="vertical"
>
<ScrollAreaThumb class="ScrollAreaThumb" />
</ScrollAreaScrollbar>
</ScrollAreaRoot>
</SelectContent>
</SelectPortal>
</SelectRoot>
</template>/* styles.css */
.ScrollAreaRoot {
width: 100%;
height: 100%;
}
.ScrollAreaViewport {
width: 100%;
height: 100%;
}
.ScrollAreaScrollbar {
width: 4px;
padding: 5px 2px;
}
.ScrollAreaThumb {
background: rgba(0, 0, 0, 0.3);
borderradius: 3px;
}Large lists
When the data your v-for reads changes, Vue re-renders every item of that v-for, because each item's slot may read the new data. With hundreds of items, add v-memo to the v-for so an item re-renders only when its own values change:
<SelectItem v-for="item in items" :key="item.value" v-memo="[item.value, item.label]" :value="item.value">
<SelectItemText>{{ item.label }}</SelectItemText>
</SelectItem>v-memo must list every value the item's props and slot read, such as :disabled. A value it leaves out goes stale when only that value changes. The selected and highlighted states don't need listing: the item tracks those itself. For very long lists, see the virtualization example above.
Accessibility
Adheres to the ListBox WAI-ARIA design pattern.
See the W3C Select-Only Combobox example for more information.
Keyboard Interactions
| Key | Description |
|---|---|
Space | When focus is on SelectTrigger, opens the select and focuses the selected item. When focus is on an item, selects the focused item. |
Enter | When focus is on SelectTrigger, opens the select and focuses the first item. When focus is on an item, selects the focused item. |
ArrowDown | When focus is on SelectTrigger, opens the Select When focus is on an item, moves focus to the next item. |
ArrowUp | When focus is on SelectTrigger, opens the Select When focus is on an item, moves focus to the previous item. |
Esc | Closes the select and moves focus to SelectTrigger. |
A-Za-z | When focus is on a closed SelectTrigger of a single select, selects the next item whose text starts with the typed characters. When focus is on an item, moves focus to the next matching item. |
Labelling
Use our Label component in order to offer a visual and accessible label for the Select
<script setup lang="ts">
import { Icon } from '@iconify/vue'
import {
Label,
SelectContent,
SelectGroup,
SelectItem,
SelectItemIndicator,
SelectLabel,
SelectPortal,
SelectRoot,
SelectSeparator,
SelectTrigger,
} from 'reka-ui'
import { ref } from 'vue'
</script>
<template>
<Label>
Country
<SelectRoot>…</SelectRoot>
</Label>
<!-- or -->
<Label for="country">Country</Label>
<SelectRoot>
<SelectTrigger id="country">
…
</SelectTrigger>
<SelectPortal>
<SelectContent>…</SelectContent>
</SelectPortal>
</SelectRoot>
</template>Custom APIs
Create your own API by abstracting the primitive parts into your own component.
Abstract down to Select and SelectItem
This example abstracts most of the parts.
Usage
<script setup lang="ts">
import { Select, SelectItem } from './your-select'
</script>
<template>
<Select default-value="2">
<SelectItem value="1">
Item 1
</SelectItem>
<SelectItem value="2">
Item 2
</SelectItem>
<SelectItem value="3">
Item 3
</SelectItem>
</Select>
</template>Implementation
// your-select.ts
export { default as Select } from 'Select.vue'
export { default as SelectItem } from 'SelectItem.vue'<!-- Select.vue -->
<script setup lang="ts">
import type { SelectRootEmits, SelectRootProps } from 'reka-ui'
import { CheckIcon, ChevronDownIcon, ChevronUpIcon, } from '@radix-icons/vue'
import { SelectContent, SelectIcon, SelectPortal, SelectRoot, SelectScrollDownButton, SelectScrollUpButton, SelectTrigger, SelectValue, SelectViewport, useForwardPropsEmits } from 'reka-ui'
const props = defineProps<SelectRootProps>()
const emits = defineEmits<SelectRootEmits>()
const forward = useForwardPropsEmits(props, emits)
</script>
<template>
<SelectRoot v-bind="forward">
<SelectTrigger>
<SelectValue />
<SelectIcon>
<ChevronDownIcon />
</SelectIcon>
</SelectTrigger>
<SelectPortal>
<SelectContent>
<SelectScrollUpButton>
<ChevronUpIcon />
</SelectScrollUpButton>
<SelectViewport>
<slot />
</SelectViewport>
<SelectScrollDownButton>
<ChevronDownIcon />
</SelectScrollDownButton>
</SelectContent>
</SelectPortal>
</SelectRoot>
</template><!-- SelectItem.vue -->
<script setup lang="ts">
import type { SelectItemProps } from 'reka-ui'
import { CheckIcon } from '@radix-icons/vue'
import { SelectItem, SelectItemIndicator, SelectItemText } from 'reka-ui'
const props = defineProps<SelectItemProps>()
</script>
<template>
<SelectItem v-bind="props">
<SelectItemText>
<slot />
</SelectItemText>
<SelectItemIndicator>
<CheckIcon />
</SelectItemIndicator>
</SelectItem>
</template>