Skip to content

SelectBox

A dropdown select built on reka-ui.

Examples

vue
<script setup>
import { ref } from "vue";
const interval = ref("weekly");
</script>

<SelectBox
  v-model="interval"
  label="Interval"
  :options="[
    { value: 'daily', label: 'Daily' },
    { value: 'weekly', label: 'Weekly' },
    { value: 'monthly', label: 'Monthly' },
  ]"
/>

Hidden label

Use hide-label to visually hide the label while keeping it available to screen readers. Prefer this over aria-label whenever you have label text, since a real <label> is translated by browsers and keeps the naming in the DOM.

vue
<SelectBox
  v-model="interval"
  label="Interval"
  hide-label
  :options="[
    { value: 'daily', label: 'Daily' },
    { value: 'weekly', label: 'Weekly' },
    { value: 'monthly', label: 'Monthly' },
  ]"
/>

Model

NameType
v-modelstring

Props

PropTypeRequiredDefault
labelstringNo
hideLabelbooleanNo
ariaLabelstringNo
optionsSelectOption[]Yes
placeholderstringNo

SelectOption

ts
interface SelectOption {
  value: string;
  label: string;
}