Components
Select Field
allows users to choose one option from a list of items
Selected Theme
Select brand or tribe name to preview style
Default
Usage
Select component to select value from options.
import { Select } from 'legion-ui';
Variant
Legion have seven variant of selectfield
Basic Select
Select...
<div style="padding:2rem; background-color: #F6F7FC;"><Selectoptions={[{ value: 'chocolate', label: 'Chocolate' },{ value: 'strawberry', label: 'Strawberry' },{ value: 'vanilla', label: 'Vanilla' },]}/></div>
Disabled
Select...
<div style="padding:2rem; background-color: #F6F7FC;"><Selectoptions={[{ value: 'chocolate', label: 'Chocolate' },{ value: 'strawberry', label: 'Strawberry' },{ value: 'vanilla', label: 'Vanilla' },]}isDisabled/>
Icon
Select...
<Selectoptions={[{ value: 'chocolate', label: 'Chocolate' },{ value: 'strawberry', label: 'Strawberry' },{ value: 'vanilla', label: 'Vanilla' },]}iconLeft={<DynamicIcon name="Search" />}/>
Label and Caption
Pilih Menu Minimal pilih satu variant
Menu
<Selectoptions={[{ value: 'chocolate', label: 'Chocolate' },{ value: 'strawberry', label: 'Strawberry' },{ value: 'vanilla', label: 'Vanilla' },]}label="Pilih Menu"placeholder="Menu"caption="Minimal pilih satu variant"
Multi Select
Support multiple selected options
Pilih Menu Minimal pilih satu variant
Menu
<Selectoptions={[{ value: 'chocolate', label: 'Chocolate' },{ value: 'strawberry', label: 'Strawberry' },{ value: 'vanilla', label: 'Vanilla' },]}label="Pilih Menu"placeholder="Menu"caption="Minimal pilih satu variant"
Show Select Option
Hide the selected option from the menu
Pilih Menu Minimal pilih satu variant
Menu
<Selectoptions={[{ value: 'chocolate', label: 'Chocolate' },{ value: 'strawberry', label: 'Strawberry' },{ value: 'vanilla', label: 'Vanilla' },]}label="Pilih Menu"placeholder="Menu"caption="Minimal pilih satu variant"
Open Menu OnSelect
Close the select menu when the user selects an option
Pilih Menu Minimal pilih satu variant
Menu
<Selectoptions={[{ value: 'chocolate', label: 'Chocolate' },{ value: 'strawberry', label: 'Strawberry' },{ value: 'vanilla', label: 'Vanilla' },]}label="Pilih Menu"placeholder="Menu"caption="Minimal pilih satu variant"
Attribute
Size
Large
Select...
Medium
Select...
Small
Select...
//large<Selectoptions={[{ value: 'chocolate', label: 'Chocolate' },{ value: 'strawberry', label: 'Strawberry' },{ value: 'vanilla', label: 'Vanilla' }]}size="lg"label="Large"
Props
property | propType | required | default | description |
---|---|---|---|---|
option | Array | - | true | Array of options that populate the select menu |
label | String | - | - | Adds helper text above your select element |
caption | String | - | - | Add field caption |
captionIcon | React.ReactNode | - | - | Add icon to the caption |
variant | normal | success | error | - | - | Change the state and outline of the select |
hideSelectedOptions | boolean | - | true | Hide the selected option from the menu |
closeMenuOnSelect | boolean | - | true | Close the select menu when the user selects an option |
isMulti | boolean | - | false | Support multiple selected options |
isDisabled | boolean | - | false | Whether the select is disabled. |
Do you have feedback?
Please let us know to make it better