A dropdown select component. It handles accessibility, open/close state, and option rendering. The children prop is a render‑prop that allows customizing the display of each option; use it together with SelectOption.
children
<Select label="Choose a fruit" value={selected} setValue={setSelected} options={[ { value: 'apple', children: 'Apple' }, { value: 'banana', children: 'Banana' }, ]} placeholder="Select an option"> {item => <SelectOption value={item.value}>{item.children}</SelectOption>}</Select> Copy
<Select label="Choose a fruit" value={selected} setValue={setSelected} options={[ { value: 'apple', children: 'Apple' }, { value: 'banana', children: 'Banana' }, ]} placeholder="Select an option"> {item => <SelectOption value={item.value}>{item.children}</SelectOption>}</Select>
Description
A dropdown select component. It handles accessibility, open/close state, and option rendering. The
childrenprop is a render‑prop that allows customizing the display of each option; use it together with SelectOption.Component
Example