@spark-web/multi-select
TypeScript icon, indicating that this package has built-in type declarations

5.1.1 • Public • Published

title: Multi-Select storybookPath: forms-select--default isExperimentalPackage: true

Allows the user to search and make multi selection from a list of values.

Example

Default

const [selectedOptions, setSelectedOptions] = React.useState();

return (
  <Stack gap="large">
    <MultiSelect
      options={[
        {
          label: '',
          options: [
            { value: 'SENT', label: 'Sent' },
            { value: 'COMPLETED', label: 'Completed' },
          ],
        },
      ]}
    />
  </Stack>
);

With Default Option

const [selectedOptions, setSelectedOptions] = React.useState();

return (
  <Stack gap="large">
    <MultiSelect
      options={[
        {
          label: 'Status',
          options: [
            { value: 'SENT', label: 'Sent' },
            { value: 'COMPLETED', label: 'Completed' },
          ],
        },
        {
          label: 'Payment',
          options: [
            { value: 'CASH', label: 'Cash' },
            { value: 'CARD', label: 'Card' },
          ],
        },
      ]}
      placeholder="Select type"
      onChange={selected => setSelectedOptions(selected)}
      defaultOptions={[
        { value: 'CASH', label: 'Cash' },
        { value: 'SENT', label: 'Sent' },
      ]}
    />
  </Stack>
);

Props

Readme

Keywords

none

Package Sidebar

Install

npm i @spark-web/multi-select

Weekly Downloads

530

Version

5.1.1

License

none

Unpacked Size

53.6 kB

Total Files

10

Last publish

Collaborators

  • brighte
  • brighte-release-bot