Component

Select

Pick an option from a dropdown menu.

Value: N/A

Installation

npx lomer-ui add select

Or copy-paste the

Usage

Bind value property to reflect select's value.

import Select from '$lib/components/ui/select.svelte'
let value = $state('');
<div class="flex flex-col items-center gap-4">
	<Select bind:value placeholder="Select a game">
		<optgroup label="PC">
			<option value="dota 2">Dota 2</option>
			<option value="manor lords">Manor Lords</option>
		</optgroup>
		<optgroup label="Mobile">
			<option value="world of tanks blitz">World of Tanks Blitz</option>
			<option value="wuthering waves">Wuthering Waves</option>
		</optgroup>
	</Select>
	<p>Value: {value || 'N/A'}</p>
</div>

Preview

Value: N/A

Examples

Loading

Add isLoading property.

<Select isLoading>
	...
</Select>

Preview

Disabled

Add isDisabled property.

<Select isDisabled>
	...
</Select>

Preview

Read only

Add isReadyOnly property.

<Select isReadOnly>
	...
</Select>

Preview