Select
Lets the user pick one option from a list that opens below the trigger at its width, joining a Field.
Parts
| Part | File | Does |
|---|---|---|
| Select | Select.vue | Groups all parts of the select. |
| SelectContent | SelectContent.vue | Holds the options of the select while it is open. |
| SelectGroup | SelectGroup.vue | Groups related options of the select. |
| SelectItem | SelectItem.vue | Offers one option the user can pick in the select. |
| SelectItemText | SelectItemText.vue | Holds the text of an option, which the select shows once chosen. |
| SelectLabel | SelectLabel.vue | Labels a group of options in the select. |
| SelectScrollDownButton | SelectScrollDownButton.vue | Scrolls the options down when the list is longer than the view. |
| SelectScrollUpButton | SelectScrollUpButton.vue | Scrolls the options up when the list is longer than the view. |
| SelectSeparator | SelectSeparator.vue | Separates groups of options in the select. |
| SelectTrigger | SelectTrigger.vue | Opens and closes the list of options in the select. |
| SelectValue | SelectValue.vue | Shows the chosen option, or a placeholder when nothing is chosen. |
Anatomy
<Select>
<SelectTrigger>
<SelectValue />
</SelectTrigger>
<SelectContent>
<SelectGroup>
<SelectLabel />
<SelectItem>
<SelectItemText />
</SelectItem>
</SelectGroup>
<SelectSeparator />
</SelectContent>
</Select>Styling
All of Select’s styles live in select.json. New to styling in Frontic UI? How styling works →
Install
- Installs with it
- focus
- npm packages
- @lucide/vue
- @vueuse/core
- class-variance-authority
- reka-ui
API reference
Groups all parts of the select.
Props 12
| Prop | Type | Default | |
|---|---|---|---|
| open | boolean | — | |
| |||
| defaultOpen | boolean | false | |
| |||
| defaultValue | AcceptableValue | AcceptableValue[] | — | |
| |||
| modelValue | AcceptableValue | AcceptableValue[] | — | |
| |||
| nullableValue | string | '' | |
| |||
| by | string | ((a: AcceptableValue, b: AcceptableValue) => boolean) | — | |
| |||
| dir | Direction | — | |
| |||
| multiple | boolean | false | |
| |||
| autocomplete | string | — | |
| |||
| disabled | boolean | false | |
| |||
| name | string | — | |
| |||
| required | boolean | false | |
| |||
Events 2
| Event | Payload | |
|---|---|---|
| update:modelValue | value: AcceptableValue | |
| ||
| update:open | value: boolean | |
| ||
Slots 1
| Slot | Slot props | |
|---|---|---|
| default | { modelValue: AcceptableValue | AcceptableValue[] | undefined; open: boolean; } | |
| ||