Oddmash UI
모든 컴포넌트

Select

목록에서 옵션을 선택합니다.

사용법

단일 선택에는 Select를 사용하세요. 기본 검증, 그룹, 다중 선택에는 HTML select 요소를 사용합니다.

접근성

레이블을 표시하세요. 방향키로 이동하고 글자로 검색하며 Enter로 선택하고 Escape로 닫습니다.

속성타입기본값
optionsreadonly SelectOption[]Required
value / defaultValuestringNone
onValueChange(value: string) => voidNone
namestringNone
<div>
  <label htmlFor="environment">Environment</label>
  <Select
    id="environment"
    name="environment"
    defaultValue="staging"
    options={[
      { value: 'staging', label: 'Staging' },
      { value: 'preview', label: 'Preview', disabled: true },
      { value: 'production', label: 'Production' },
    ]}
  />
</div>

인터랙티브 문서