Select
The Select component provides a custom dropdown with a trigger button and a listbox of options.
Basic Usage
Apple
Banana
import { Select } from "@paramanu/forms-react"
export default function App() { return ( <Select placeholder="Select..."> <div role="option">Apple</div> <div role="option">Banana</div> </Select> )}<div class="pm-select pm-select--outline pm-select--md"> <button type="button" class="pm-select__trigger" role="combobox" aria-expanded="false" aria-haspopup="listbox">Select...</button> <div class="pm-select__listbox" role="listbox"> <div role="option">Apple</div> <div role="option">Banana</div> </div></div>Accessibility
| Feature | Detail |
|---|---|
role="combobox" | Trigger button role |
aria-expanded | Reflects open state |
aria-haspopup="listbox" | Indicates dropdown type |
| Keyboard | Enter/Space opens, Arrow keys navigate |
Props
| Prop | Type | Default | Description |
|---|---|---|---|
variant | "outline" | "filled" | "unstyled" | "outline" | Visual variant |
size | "xs" | "sm" | "md" | "lg" | "md" | Select size |
invalid | boolean | false | Invalid state |
disabled | boolean | false | Disabled state |
open | boolean | false | Open state |
fullWidth | boolean | false | Full-width layout |
CSS Classes
| Class | Description |
|---|---|
pm-select | Base class |
pm-select__trigger | Trigger button |
pm-select__listbox | Options container |
pm-select--open | Open state |