I want to show categories and sub categories in a dropdown similar to select with option group in html.
How should I do it in semantic-ui. I didn't find any help on it.
I don't know if you still need this since the question is a bit old but I found this Fiddle.
Basically you would use div
instead of select
and option
.
<div class="ui selection dropdown multiple search optgroup">
<div class="text">Select</div>
<i class="dropdown icon"></i>
<div class="menu">
<div class="ui horizontal divider">Optgroup 1</div>
<div class="item">Option 1</div>
<div class="item">Option 2</div>
<div class="ui horizontal divider">Optgroup 2</div>
<div class="item">Option 3</div>
<div class="item">Option 4</div>
</div>
</div
.dropdown.optgroup .divider {
border-top: none !important;
}
$('.ui.dropdown').dropdown();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With