āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā ā š shadcn/directory/sadmann7/diceui/components/listbox ā āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā
@diceui/listbox
npx shadcn@latest add "https://diceui.com/r/listbox"
```package-install
@diceui/listbox
```
</Step>
<Step>
Copy and paste the following code into your project.
<ComponentSource name="listbox" />
</Step>
</Steps>
Import the parts, and compose them together.
import * as Listbox from "@diceui/listbox"
<Listbox.Root>
<Listbox.Group>
<Listbox.GroupLabel/>
<Listbox.Item >
<Listbox.ItemIndicator />
</Listbox.Item>
</Listbox.Group>
</Listbox.Root>
Set orientation="horizontal" to create a horizontally navigable list.
For grid layouts, use orientation="mixed" to enable navigation in both directions.
Use CSS Grid to arrange the items in a grid structure. In grid layouts,
arrow keys will navigate accordingly:
Group items together to create a list of related options.
<ComponentTabs name="listbox-group-demo" />The root component for creating listboxes.
<AutoTypeTable path="./types/docs/listbox.ts" name="RootProps" />
A group of items inside the selectable list.
<AutoTypeTable path="./types/docs/listbox.ts" name="GroupProps" />
A label for the group of items.
<AutoTypeTable path="./types/docs/listbox.ts" name="GroupLabelProps" />
An item inside the selectable list.
<AutoTypeTable path="./types/docs/listbox.ts" name="ItemProps" />
A visual indicator that shows when the item is selected.
<AutoTypeTable path="./types/docs/listbox.ts" name="ItemIndicatorProps" />
<KeyboardShortcutsTable shortcuts={[ { keys: ["Tab"], description: "Focuses the last active item in the list.", }, { keys: ["Shift + Tab"], description: "Moves focus to previous focusable item in the list.", }, { keys: ["ArrowUp"], description: "Moves highlighting to previous item in vertical lists.", }, { keys: ["ArrowDown"], description: "Moves highlighting to next item in vertical lists.", }, { keys: ["ArrowLeft"], description: "Moves highlighting to previous item in horizontal lists.", }, { keys: ["ArrowRight"], description: "Moves highlighting to next item in horizontal lists.", }, ]} />
ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā ā
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā