Toggle Sidebar B
AppearanceLight & dark mode D

Native Select

A styled native HTML select element with consistent design system integration. For search, multi-select, or custom option markup, use Select or Combobox instead.

Default

Options placed directly under NativeSelect, no group wrapper.

Dark previewReplay preview

Groups

Use NativeSelectOptGroup to organize options into categories.

Dark previewReplay preview

Disabled

Add the disabled prop to the NativeSelect component to disable the select.

Dark previewReplay preview

Invalid

Use aria-invalid to show validation errors, and data-invalid on the surrounding Field for styling.

Dark previewReplay preview

Anatomy

Import all parts and piece them together.

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

<template>
  <NativeSelect>
    <NativeSelectOptGroup>
      <NativeSelectOption />
    </NativeSelectOptGroup>
    <NativeSelectOption />
  </NativeSelect>
</template>

API Reference

NativeSelect

PropTypeDefaultDescription
modelValuestring | string[]""Selected value. Supports v-model.
size"sm" | "default""default"Control height. sm renders the compact variant.
disabledbooleanfalseDisable the select. Forwarded to the native element.
classstringMerged onto the native select element.
EventDescription
update:modelValueFires when the selection changes. Enables v-model.
SlotDescription
defaultNativeSelectOption and NativeSelectOptGroup children.

NativeSelectOption

PropTypeDefaultDescription
valuestringValue committed when the option is selected.
disabledbooleanfalseDisable selection of this option.

NativeSelectOptGroup

PropTypeDefaultDescription
labelstringGroup heading rendered by the browser.
disabledbooleanfalseDisable every option in the group.

Accessibility

Keyboard shortcuts and ARIA behavior.

Shortcut Description
SpaceOpens the native dropdown.
Moves to the previous option.
Moves to the next option.
HomeJumps to the first option.
EndJumps to the last option.
EscCloses the dropdown without changing the value.
  • Renders a real select element, so the browser supplies the full listbox semantics and the platform-native dropdown on mobile.
  • Pair with Field and FieldLabel for a labelled control; aria-invalid drives the destructive border and ring.