Docs
Select

Select

Displays a list of options for the user to pick from—triggered by a button.

Loading...

Installation

	npx svell@latest add select

Usage

	<script lang="ts">
  import * as Select from "$lib/components/ui/select";
</script>
 
<Select.Root>
  <Select.Trigger class="w-[180px]">
    <Select.Value placeholder="Theme" />
  </Select.Trigger>
  <Select.Content>
    <Select.Item value="light">Light</Select.Item>
    <Select.Item value="dark">Dark</Select.Item>
    <Select.Item value="system">System</Select.Item>
  </Select.Content>
</Select.Root>

Examples

Form

For more advanced usage and to learn how to implement multiple Select components in a form, check out the Bits UI Select Recipe on Formsnap.

Loading...

Built & designed by shadcn. Ported to Svelte by netronk. The source code is available on GitHub.