- Accordion new
- ActionSheet new
- Alert new
- Alert Dialog new
- Angle Slider new
- Autocomplete new
- Avatar new
- Badge new
- Breadcrumb new
- Button new
- Button Group new
- Card new
- Carousel new
- Checkbox new
- Clipboard new
- Collapsible new
- Color Picker new
- Date Input new
- Date Picker new
- Dialog new
- DialogCaller new
- Drawer beta
- Editable new
- Empty new
- Field new
- Fieldset new
- File Upload new
- Filters new
- Floating Panel new
- Hover Card new
- Image new
- Image Cropper new
- Input new
- Input Group new
- Json Tree View new
- Kbd new
- Listbox new
- Marquee new
- Menu new
- Number Input new
- Pagination new
- Password Input new
- PhoneField new
- Pin Input new
- Popover new
- Progress Circular new
- Progress Linear new
- Qr Code new
- Radio Group new
- Rating Group new
- Scroll Area new
- ScrollSpy new
- Segment Group new
- Select new
- Separator new
- Sidebar new
- Signature Pad new
- Skeleton new
- Slider new
- Splitter new
- Steps new
- Switch new
- Table new
- Tabs new
- Tags Input new
- Textarea new
- Timeline new
- Timer new
- Toast new
- Toc new
- Toggle new
- Toggle Group new
- Tooltip new
- Tour new
- Tree View new
- Typography new
Installation
Install from the Vuzeno registry:
bunx --bun shadcn-vue@latest add https://vuzeno.com/r/listbox.json
npx shadcn-vue@latest add https://vuzeno.com/r/listbox.json
yarn dlx shadcn-vue@latest add https://vuzeno.com/r/listbox.json
pnpm dlx shadcn-vue@latest add https://vuzeno.com/r/listbox.json
Usage
<script setup lang="ts">
import { Listbox } from "@/components/ui/listbox";
</script>
<template>
<Listbox.Root>
<!-- … -->
</Listbox.Root>
</template>
Examples
Controlled
The Listbox component can be controlled by using the value and onValueChange props. This allows you to manage the selected value externally.
Root Provider
An alternative way to control the listbox is to use the RootProvider component and the useListbox hook. This way you can access the state and methods from outside the component.
Disabled Item
Listbox items can be disabled using the disabled prop on the collection item.
Multiple
You can set the selectionMode property as multiple to allow the user to select multiple items at a time.
Grouping
The Listbox component supports grouping items. You can use the groupBy function to group items based on a specific property.
Extended Selection
The extended selection mode allows users to select multiple items using keyboard modifiers like Cmd (Mac) or Ctrl (Windows/Linux).
Horizontal
Use the orientation prop to display the listbox items horizontally.
Grid Layout
Use createGridCollection to display items in a grid layout with keyboard navigation support.
Filtering
Use useListCollection with the filter function to enable filtering of items.
Select All
Use useListboxContext to implement a "Select All" functionality that allows users to select or deselect all items at once.
Value Text
Use Listbox.ValueText to display the selected values as a comma-separated string.
Composition
Listbox.Root
├── Listbox.Context
├── Listbox.Content
├── Listbox.Empty
├── Listbox.Input
├── Listbox.Item
├── Listbox.ItemContext
├── Listbox.ItemGroup
├── Listbox.ItemGroupLabel
├── Listbox.ItemIndicator
├── Listbox.ItemText
├── Listbox.Label
├── Listbox.RootProvider
├── Listbox.ValueText
API
See Ark UI Listbox docs for full props and examples.