Select

Pick one from a list. Opens under the field with the chosen option ticked; arrow keys move, typing jumps to a match.

Example

<Field label="Vessel">
	<Select
		bind:value={vessel}
		placeholder="Choose a vessel"
		options={vessels.map((v) => ({ value: v.id, label: v.name }))}
	/>
</Field>

Groups

Pass groups of options; each gets a heading.

Rules

  • Two or three options that all fit: segmented Tabs or radios instead, so they're seen at once.
  • A long list people search in, like organisations or waypoints: a combobox (coming).
  • Options are short, one line each. Order them the way people look for them: by use, or alphabetically.
  • Placeholder only when there's no sensible default. Otherwise preselect it.