Select

Accessible dropdown built on Radix UI. Supports error and disabled states.

Live Demo

Please select a fruit.

Props

PropTypeDefaultDescription
optionsSelectOption[]componentPages.select_prop_options
labelstringcomponentPages.select_prop_label
placeholderstring'Select an option'componentPages.select_prop_placeholder
valuestringcomponentPages.select_prop_value
defaultValuestringcomponentPages.select_prop_defaultValue
onValueChange(value: string) => voidcomponentPages.select_prop_onValueChange
errorstringcomponentPages.select_prop_error
helperTextstringcomponentPages.select_prop_helperText
size'sm' | 'md' | 'lg''md'componentPages.select_prop_size
disabledbooleanfalsecomponentPages.select_prop_disabled

Usage

import { Select } from '@ghiberti85/ui'

const options = [
  { value: 'apple', label: 'Apple' },
  { value: 'banana', label: 'Banana' },
  { value: 'cherry', label: 'Cherry' },
]

// Basic
<Select label="Fruit" options={options} placeholder="Pick a fruit" />

// With error
<Select label="Fruit" options={options} error="Please select a fruit" />

// Sizes
<Select label="Fruit" options={options} size="sm" />
<Select label="Fruit" options={options} size="lg" />

// Disabled
<Select label="Fruit" options={options} disabled />

// Controlled
<Select
  label="Fruit"
  options={options}
  value={value}
  onValueChange={setValue}
/>

View in Storybook

Open in Storybook
Ghiberti UI — Design System