Skip to content

Option grouping #135

Open
Open
@lysdexic-audio

Description

@lysdexic-audio

This is a perfect little component. In some cases where there are many fields it would be nice if a single Multiselect could contain several options, perhaps like this:

<script>
  import MultiSelect from 'svelte-multiselect'

  const genreTags = [`Rock`, `Electronic`, `Opera`]
  const keyTags = [`C`, `D`, `E`, `F`, `G`, `A`, `B`]
  const scaleTags = [`Major`, `Minor`]

  let selectedTags = []
</script>

<MultiSelect
  bind:selectedTags
  options={[genreTags, keyTags, scaleTags]}
  maxSelect={[null, 1, 1]}
  required={[true, true, false]}
  placeholder="Select Tags"
/>

I need this in my app - are you open to an PR (if this isn't already supported)?

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionGathering feedback on open questionsenhancementNew feature or requesthelp wantedExtra attention is neededuxUser experience

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions