Multiselect

Pick several from a list: methods to filter by, waypoints to include, people to notify.

Tags in the field

What’s picked shows as tags; × takes one out, Backspace the last.

CTD Water samples
<Field label="Sampling methods">
	<Multiselect bind:value={methods} options={[
		{ value: 'ctd', label: 'CTD', dot: 'bg-violet-600' },
		{ value: 'water', label: 'Water samples', dot: 'bg-sky-600' },
	]} />
</Field>

<Multiselect bind:value={stations} options={waypoints} max={3} placeholder="Pick waypoints" />

Grouped, with a limit

Options under headings; past three tags, a count.

AU1 AU12 L3 +2

5 of 9 picked

With descriptions

Rules

  • For several from a list too long to show as checkboxes. Up to about five options, show checkboxes.
  • The list stays open while picking. Escape or a click away closes it.
  • Where the tags would crowd the field, set `max`: the rest are counted, "+3".
  • Identity colours as dots, the same as on tags elsewhere. Never a status.
  • Search on what people know things by: an MMSI, an organization, as `keywords` or `description`.