Skip to content
LoidoltTheme 0.11.1
Svelte 5

Component

Select

A native select over an `Option[]`.

import { Select } from '@loidolt/theme-svelte';

Example

Value: unset

Notes

  • The placeholder stays selectable unless the field is required.
  • Pass { label, options } entries to group options under native <optgroup> headings.

Props

Generated from the component source, so it cannot drift from the implementation.

Select props
PropTypeDefaultNotes
options required OptionEntry<T>[]—Options, optionally in labelled groups — rendered as native <optgroup>s.
boxed booleanfalseDraws the full box instead of the default underline.
class string—
label string—Accessible name when the select is not wrapped in a Field or <label>.
onValueChange (value: T | '') => void—
placeholder string—Empty-choice text. Selectable again after a real choice unless the field is required, so a user can undo their selection.
ref bindableHTMLSelectElement | nullnull
value bindableT | ''''

Plus the attributes of Omit<HTMLSelectAttributes, 'value'>, forwarded to the root element.