To enable multiple selections, set the selectionMode prop to multiple. This prop has no default value, so it must be explicitly defined.
list-box-multiple-demo
Apple
Banana
Orange
Strawberry
Grapes
Mango
Pineapple
Selected: 3
Description
You can enhance list items by providing additional details using the Listbox.Description component.
list-box-description-demo
AdminHas full access to all resources
EditorCan edit content but has limited access to settings
ViewerCan view content but cannot make changes
ContributorCan contribute content for review
GuestLimited access, mostly for viewing purposes
Section
Group items in a ListBox using sections for better organization.
list-box-section-demo
The Beatles
Abbey Road
Sgt. Pepper's Lonely Hearts Club Band
Revolver
Led Zeppelin
Led Zeppelin IV
Physical Graffiti
Houses of the Holy
Led Zeppelin II
Pink Floyd
The Dark Side of the Moon
The Wall
Wish You Were Here
Animals
Meddle
Queen
A Night at the Opera
News of the World
Sheer Heart Attack
The Game
Jazz
Queen II
The Rolling Stones
Let It Bleed
Sticky Fingers
Exile on Main St.
Beggars Banquet
Some Girls
Tattoo You
Nirvana
Nevermind
In Utero
Bleach
The Doors
The Doors
L.A. Woman
Strange Days
Morrison Hotel
Radiohead
OK Computer
Kid A
The Bends
In Rainbows
AC/DC
Back in Black
Highway to Hell
Let There Be Rock
The Who
Who's Next
Tommy
Quadrophenia
My Generation
The Who Sell Out
Drag and drop
Enable drag-and-drop functionality in the ListBox by using the dragAndDropHooks prop with the useDragAndDrop hook. This allows users to rearrange items, insert new entries, or manage data across the list.
list-box-rearrange-demo
Nirvana
Radiohead
Foo Fighters
Arctic Monkeys
The Strokes
Infinite scrolling
ListBox can handle large datasets efficiently with infinite scrolling. This allows for loading more data as the user scrolls down, improving performance and user experience.
list-box-infinite-scroll-demo
Controlled
To enable controlled mode, set the selectionMode prop to single. This allows you to manage the ListBox selection using the selectedKey prop.
list-box-controlled-demo
Apple
Banana
Orange
Strawberry
Grapes
Mango
Pineapple
Selected: 1
Disabled
Disable specific ListBox items to restrict user interaction.
list-box-disabled-demo
Apple
Banana
Orange
Strawberry
Grapes
Mango
Pineapple
You can also disable an item directly by passing the isDisabled prop to ListBoxItem.