You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix Layout.Panel resize handler not working properly on touch devices by adding `touch-action: none` to prevent browser scroll interference during drag
Sections and items can be defined dynamically using the `items` prop with a render function. Pass hierarchical data where each section contains a `children` array.
For large datasets, use the `items` prop with a render function. This enables automatic virtualization — only visible items are rendered in the DOM, providing smooth scrolling even with thousands of items. Virtualization is disabled when sections are present.
Sections and items can be defined dynamically using the `items` prop with a render function. Pass hierarchical data where each section contains a `children` array.
252
+
253
+
```jsx
254
+
constcategories= [
255
+
{ name:'Fruits', children: [
256
+
{ key:'apple', label:'Apple' },
257
+
{ key:'banana', label:'Banana' },
258
+
]},
259
+
{ name:'Vegetables', children: [
260
+
{ key:'carrot', label:'Carrot' },
261
+
{ key:'broccoli', label:'Broccoli' },
262
+
]},
263
+
];
264
+
265
+
<FilterListBox label="Choose an ingredient" searchPlaceholder="Search ingredients..." items={categories}>
'Sections and items can be defined dynamically using the `items` prop with a render function. Pass hierarchical data where each section contains a `children` array.',
Copy file name to clipboardExpand all lines: src/components/fields/ListBox/ListBox.docs.mdx
+42-8Lines changed: 42 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -327,6 +327,33 @@ Groups related items together with an optional heading.
327
327
</ListBox>
328
328
```
329
329
330
+
### With Sections (Dynamic)
331
+
332
+
<Storyof={ListBoxStories.DynamicSections} />
333
+
334
+
Sections and items can be defined dynamically using the `items` prop with a render function. Pass hierarchical data where each section contains a `children` array.
- No sections are present (sections disable virtualization)
741
-
- Provides smooth scrolling even with large datasets
742
-
- Only visible items are rendered in the DOM
743
-
- Uses `@tanstack/react-virtual` for efficient rendering
744
-
- Automatically measures item heights for consistent scrolling
745
-
- Supports items with varying heights (descriptions, complex content)
766
+
<Storyof={ListBoxStories.VirtualizedList} />
767
+
768
+
For large datasets, use the `items` prop with a render function. This enables automatic virtualization — only visible items are rendered in the DOM, providing smooth scrolling even with thousands of items.
0 commit comments