Skip to content

Multiple selection ​

Add the native multiple attribute. Chosen options become chips, and you type in the control to filter.

  1. Events appear here.
html
<select name="tags" multiple data-flow-select data-fs-placeholder="Add tags...">
  <option value="design" selected>Design</option>
  <option value="css">CSS</option>
</select>

Behaviour ​

  • Choosing an option keeps the list open, so you can pick several.
  • Choosing a chosen option again removes it (the row shows a check mark).
  • Your typed text is cleared after each pick.
  • Each chip has a remove button.

To close after every pick, set data-fs-close-on-select="true".

Keyboard ​

KeyAction
TypeFilters the list
EnterAdds or removes the highlighted option
Backspace in an empty inputRemoves the last chip
← in an empty inputHighlights the last chip; ← → move between chips
Backspace or Delete on a highlighted chipRemoves it

Limit the number of choices ​

html
<select multiple data-flow-select data-fs-max-items="3">...</select>

When the limit is reached, further picks are refused and screen readers hear "You can choose up to 3".

Hide chosen options ​

By default chosen options stay in the list with a check mark, so they can be removed from there too. To hide them instead, add data-fs-hide-selected. Removing a chip puts the option back.

html
<select multiple data-flow-select data-fs-hide-selected>...</select>

Without typing ​

With data-fs-search="false" the input is read only: no on-screen keyboard on phones, and letters jump to matches instead of filtering.

What the form sends ​

Exactly what a native multiple select sends: one field per chosen option, in the order they were chosen. Nothing is sent when nothing is chosen. For PHP, name the select tags[]. See Forms and servers.

Released under the MIT License.