Appearance
Select
Chọn từ danh sách — ưu tiên hơn Combobox trên Mobile-First.
ts
import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from "@minap/ui";Examples
Mẫu sống trong Preview; chọn View code khi cần copy.
Usage
tsx
import { FormField, Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@minap/ui";
export function Example() {
return (
<>
<FormField id="emb-role" label="Role">
<Select defaultValue="editor">
<SelectTrigger aria-label="Role">
<SelectValue placeholder="Choose" />
</SelectTrigger>
<SelectContent>
<SelectItem value="viewer">Viewer</SelectItem>
<SelectItem value="editor">Editor</SelectItem>
<SelectItem value="admin">Admin</SelectItem>
</SelectContent>
</Select>
</FormField>
</>
);
}Props / API
| Prop / API | Type | Default | Notes |
|---|---|---|---|
value / defaultValue | string | — | Select root |
onValueChange | (v: string) => void | — | |
disabled | boolean | false | Trên root hoặc trigger |
SelectTrigger aria-invalid | boolean | — | FormField gắn sẵn |
Behavior
- Trigger chiều cao touch
- SelectGroup / SelectLabel / SelectSeparator