Select Input
The <Select/>
component allows to select or deselect options in a form. It provides a customizable checkbox input with various options.
- Usage
- Props
Import
import { Select, SelectGroup } from "matro-ui";
SelectGroup
: The wrapper that provides context and logic to the components.Select
: The select input itself.
Usage
Loading...
Live Editor
<SelectGroup defaultValue="_"> <Select value="_" disabled>Select Value</Select> <Select value="2">2</Select> <Select value="3">3</Select> </SelectGroup>
Prop fitContent
Pass the fitContent
prop to set width value to: fit-content.
Loading...
Live Editor
<SelectGroup defaultValue="_" fitContent> <Select value="_" disabled>Select Value</Select> <Select value="2">2</Select> <Select value="3">3</Select> </SelectGroup>
Props of <SelectGroup/>
:
<SelectGroup/>
:defaultValue
DescriptionThe defauilt value of the group.
Typeboolean
onChange
DescriptionCallback function triggered when the input value changes.
Typefunction
name
DescriptionThe name attribute of the input.
Typestring
style
DescriptionAdditional styling prop.
Typeobject
children
DescriptionAny possible React Children. At least one <Select/> is required.
TypeReact.FC | React.FC[] | string | number
fitContent
DescriptionSet width to fit-content if true.
Typeboolean
Props of <Select/>
:
<Select/>
:value
DescriptionSelect option value.
Typestring | number
disabled
DescriptionDisables of the select option.
Typeboolean