Skip to Content
Archi-ui 1.0.25 is released 🎉

Select

Select components are used for collecting user provided information from a list of options.

Basic Select

Menus are positioned under their emitting elements, unless they are closed to the bottom of the viewport.

Usage

import { Select, MenuItem } from 'archi-ui'
<Select> <MenuItem value='Item 1'>Item 1</MenuItem> <MenuItem value='Item 2'>Item 2</MenuItem> <MenuItem value='Item 3'>Item 3</MenuItem> <MenuItem value='Item 4'>Item 4</MenuItem> </Select>

Variant

The Select comes with three variants: outlined(default), filled, standard.

None
None
None

Helper text

None

Helper text

Size

None
None
None

Other props

None

Disabled

None

Error

None

Read only

None

Required

With a dialog

Select API

API reference docs for the React Select component.

Props

NameTypeDefaultDescription
childrennode-The option elements to populate the select with. Can be some MenuItem when native is false and option when native is true. The MenuItem elements must be direct descendants when native is false.
classNamestring-Override or extend the styles applied to the component
variant'filled' | 'outlined' | 'standard''outlined'The variant to use.
color'primary' | 'secondary' | 'info' | 'warning' | 'success' | 'error'primaryThe color of the componenet.
fullwidthboolfalseIf true, the select will take up the full width of its container.
size'sm' | 'md' | 'lg''md'The size of the component.
errorboolfalseIf true, the input will indicate an error, The prop defaults to the value(false) inherited from the parent FormControl component.
defaultOpenboolfalseIf true, the component is initially open, Use when the component open state is not controlled (i.e. the open is not defined). You can only use it when the native prop is false (default)
defaultValueany-The default value, Use when the component is not controlled.
displayEmptyboolfalseIf true, a value is displayed even if no items are selected. In order to display a meaningful value.
IconComponentnode<ChevronDown />The icon that displays the arrow.
MenuPropsobject-Props applied to Menu element.
nativeboolfalseIf true, the component uses a native select element.
multipleboolfalseIf true, value must be an array and the menu will support multiple selections.
openboolfalseIf true, the component is shown, You can only use it when the native prop is false(default).
onClosefunc-Callback fired when the component is requests to be closed.
Signature: function() => void.
onOpenfunc-Callback fired when the component is requests to be opened.
Signature: function() => void.
renderValuefunc-Rebder the selected value. You can only use it when native prop is false(default).
Signature: function(value: any) => ReactNode
- value: the value provided to the component.
onValueChangefunc-Callback fired when the menu item is selected.
Signature: function(value: any) => void
- value: You can pull out the new value by accessing value(any).
valueany-The value of the select component, required for controlled component.
scrollLockbooltrueThe value of the select component, required for controlled component.
Last updated on