Native Select

New

A styled native select element.

Preview ​

Installation ​

npx sigma-ui@latest add native-select

Usage ​

vue
<script setup lang="ts">
import { NativeSelect, NativeSelectOption } from '@/components/ui/native-select';

const fruit = ref('');
</script>

<template>
  <NativeSelect v-model="fruit" aria-label="Fruit">
    <NativeSelectOption value="apple">Apple</NativeSelectOption>
    <NativeSelectOption value="banana">Banana</NativeSelectOption>
  </NativeSelect>
</template>

NativeSelect binds with v-model. Group options with NativeSelectOptGroup. Native attributes such as disabled and multiple pass through to the <select>.

Examples ​

Groups ​

API Reference ​

NativeSelect ​

Props

PropType Default
modelValue
AcceptableValue | AcceptableValue[]""

Events

EventPayload
update:modelValue
[value: AcceptableValue | AcceptableValue[]]

Slots

SlotScope
default

NativeSelectOption and NativeSelectOptGroup children.

-

NativeSelectOptGroup ​

Slots

SlotScope
default

NativeSelectOption children of this group.

-

NativeSelectOption ​

Slots

SlotScope
default

Label of the option.

-

Accessibility ​

This is a native <select>, so the browser provides the listbox behavior and keyboard support. Give it a <label> or aria-label.

KeyDescription
TabMoves focus to the select.
Space or EnterOpens the option list.
ArrowUp or ArrowDownMoves between options.
EscCloses the list.
Edit this page on GitHub