Select
목록에서 옵션을 선택합니다.
사용법
단일 선택에는 Select를 사용하세요. 기본 검증, 그룹, 다중 선택에는 HTML select 요소를 사용합니다.
접근성
레이블을 표시하세요. 방향키로 이동하고 글자로 검색하며 Enter로 선택하고 Escape로 닫습니다.
| 속성 | 타입 | 기본값 |
|---|---|---|
| options | readonly SelectOption[] | Required |
| value / defaultValue | string | None |
| onValueChange | (value: string) => void | None |
| name | string | None |
<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>