Option grouping
See original GitHub issueThis 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)?
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:6 (3 by maintainers)
Top Results From Across the Web
<optgroup>: The Option Group element - MDN Web Docs
The <optgroup> HTML element creates a grouping of options within a <select> element. Try it. HTML Demo: <optgroup>. Reset. HTML CSS
Read more >HTML optgroup tag - W3Schools
The <optgroup> tag is used to group related options in a <select> element (drop-down list). If you have a long list of options,...
Read more >H85: Using optgroup to group option elements inside a select
In HTML, the select element is used to create both multi-select lists and combo boxes. The various allowed options are each indicated with...
Read more >Options Group > Options Group Home
See why Options Group is the premier global recruiting firm for financial services with executive search talent planning, acquisition and retention.
Read more >HTML: <optgroup> tag - TechOnTheNet
The HTML <optgroup> tag creates a group of options within a dropdown list of values in the <select> control. These dropdown values are...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

allowUserOptionsentirely when options are grouped for now.defaultDisabledTitlefor all groups.As I said, happy to take a PR for this. Though the default way to group options should be an object of arrays imo:
We can expand to
later.
Sorry @janosh bit too pressured at work to get onto doing this properly - working around it for now. Anyone else wants to jump in please do