1. framework components
  2. listbox

Listbox

Accessible listbox for single and multi selection.

  • Apple
  • Banana
  • Orange
  • Carrot
  • Broccoli
  • Spinach

Groups

Organize items into categorized groups.

  • Apple
  • Banana
  • Orange
  • Carrot
  • Broccoli
  • Spinach

Multiple

Set the multiple proper to allow selecting more than one item.

  • Apple
  • Banana
  • Orange
  • Carrot
  • Broccoli
  • Spinach

Disabled

Set the disabled prop to enable the disabled state.

  • Apple
  • Banana
  • Orange
  • Carrot
  • Broccoli
  • Spinach

Which can also be enabled per item.

  • Apple
  • Banana
  • Orange
  • Carrot
  • Broccoli
  • Spinach

Utilize the Input component to implement simple search.

  • Apple
  • Banana
  • Orange
  • Carrot
  • Broccoli
  • Spinach

Direction

Set the text direction (ltr or rtl) using the dir prop.

  • Apple
  • Banana
  • Orange
  • Carrot
  • Broccoli
  • Spinach

Anatomy

Here’s an overview of how the Listbox component is structured in code:

svelte
<script lang="ts">
	import { Listbox } from '@skeletonlabs/skeleton-svelte';
</script>

<Listbox>
	<Listbox.Label />
	<Listbox.Content>
		<Listbox.Item>
			<Listbox.ItemText />
			<Listbox.ItemIndicator />
		</Listbox.Item>
	</Listbox.Content>
</Listbox>

API Reference

Unable to load component information for svelte/listbox

View page on GitHub