MultiSelect
MultiSelect component is used to select one or multiple option from given options.
Import#
import { MultiSelect } from '@incmix/ui'
Usage#
Single Mode#
- No results found
import { useState } from 'react'const MultiSelectExample = () => {const [value, setValue] = useState('')const options = [{label: 'Tesla',value: 'Tesla',},{label: 'Volvo',value: 'Volvo',},]return <MultiSelect options={options} value={value} label="Choose an item" onChange={setValue} single />}
Multi Mode#
- No results found
import { useState } from 'react'const MultiSelectExample = () => {const [value, setValue] = useState([])const options = [{label: 'Tesla',value: 'Tesla',},{label: 'Volvo',value: 'Volvo',},]return <MultiSelect options={options} value={value} label="Choose an item" onChange={setValue} />}
Create + Single Mode#
- No results found
import { useState } from "react"import { useMultiSelect } from "@incmix/uiconst MultiSelectExample = () => {const { value, options, onChange } = useMultiSelect({value: single? '' : [],options: []})return(<MultiSelectoptions={options}value={value}label='Choose an item'onChange={setValue}createsingle/>)}
Multi + Create Mode#
- No results found
import { useState } from "react"import { useMultiSelect } from "@incmix/uiconst MultiSelectExample = () => {const { value, options, onChange } = useMultiSelect({value: single? '' : [],options: []})return(<MultiSelectoptions={options}value={value}label='Choose an item'onChange={setValue}create/>)}