Skip to content

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.json

Preview

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.json

GitHub 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.json

Usage

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

PropTypeDefault
valuestring | string[]—
defaultValuestring | string[]—
onValueChange(value) => void—
multipleboolean—
disabledboolean—

ListBoxSection

PropTypeDefault
labelReact.ReactNode—