Forms
Navigation & layout
Data display & feedback
Date & time
Browse components
← All components
List Box
Standalone list box for selecting one or more items.
Install
npx shadcn@latest add https://ui.anuragroy.dev/r/list-box.jsonPreview
Loading preview…
Installation
Add the component from this site. The shadcn CLI fetches the registry JSON over HTTPS — no named registry submission required.
Terminal
npx shadcn@latest add https://ui.anuragroy.dev/r/list-box.jsonGitHub fallback if the website is down:
Terminal
npx shadcn@latest add https://raw.githubusercontent.com/anurag-roy/ui.anuragroy.dev/main/public/r/list-box.jsonUsage
Import paths follow your components.json aliases. After install, the default path is @/components/ui/list-box.
Import
import { ListBox, ListBoxItem, ListBoxSection} from "@/components/ui/list-box"example.tsx
import { ListBox, ListBoxItem, ListBoxSection } from "@/components/ui/list-box"export function Example() { return ( <ListBox defaultValue="a"> <ListBoxSection label="Letters"> <ListBoxItem value="a">Alpha</ListBoxItem> <ListBoxItem value="b">Beta</ListBoxItem> </ListBoxSection> </ListBox> )}API Reference
ListBox
| Prop | Type | Default |
|---|---|---|
| value | string | string[] | — |
| defaultValue | string | string[] | — |
| onValueChange | (value) => void | — |
| multiple | boolean | — |
| disabled | boolean | — |
ListBoxSection
| Prop | Type | Default |
|---|---|---|
| label | React.ReactNode | — |