List Box

PreviousNext

list-box-demo

Docs
intentuipage

Preview

Loading preview…
components/docs/collections/list-box/list-box-demo.tsx
"use client"

import { ListBox, ListBoxItem } from "@/components/ui/list-box"

export default function ListBoxDemo() {
  return (
    <ListBox className="max-w-2xs" items={rockPopBands} selectionMode="single" aria-label="Bands">
      {(item) => <ListBoxItem id={item.id}>{item.name}</ListBoxItem>}
    </ListBox>
  )
}

const rockPopBands = [
  { id: "1", name: "Nirvana" },
  { id: "2", name: "Radiohead" },
  { id: "3", name: "Foo Fighters" },
  { id: "4", name: "Arctic Monkeys" },
  { id: "5", name: "The Strokes" },
]

Installation

npx shadcn@latest add @intentui/list-box-demo

Usage

Usage varies by registry entry. Refer to the registry docs or source files below for details.