mirror of
https://github.com/nextui-org/nextui.git
synced 2025-12-08 19:26:11 +00:00
chore(docs): add note itemHeight for virtualization (#4822)
* chore(docs): add note itemHeight for virtualization * fix: format
This commit is contained in:
parent
628bcdefeb
commit
c659e2f215
@ -337,6 +337,8 @@ The `maxListboxHeight` prop is used to set the maximum height of the listbox. Th
|
||||
|
||||
The `itemHeight` prop is used to set the height of each item in the listbox. This is required when using virtualization. By default, it's set to `32`.
|
||||
|
||||
> **Note**: If the height of the list items differs from the default due to `startContent` or other custom content, be sure to pass the correct value to `itemHeight` to prevent layout issues.
|
||||
|
||||
<CodeDemo title="Custom Item Height" files={autocompleteContent.virtualizationCustomItemHeight} />
|
||||
|
||||
### With Sections
|
||||
|
||||
@ -153,7 +153,7 @@ function App() {
|
||||
|
||||
### Virtualization
|
||||
|
||||
Select supports virtualization, which allows efficient rendering of large lists by only rendering items that are visible in the viewport. You can enable virtualization by setting the `isVirtualized` prop to `true`.
|
||||
Listbox supports virtualization, which allows efficient rendering of large lists by only rendering items that are visible in the viewport. You can enable virtualization by setting the `isVirtualized` prop to `true`.
|
||||
|
||||
<CodeDemo
|
||||
title="Virtualization"
|
||||
|
||||
@ -241,8 +241,9 @@ The `maxListboxHeight` prop is used to set the maximum height of the listbox. Th
|
||||
|
||||
The `itemHeight` prop is used to set the height of each item in the listbox. This is required when using virtualization. By default, it's set to `32`.
|
||||
|
||||
<CodeDemo title="Custom Item Height" files={selectContent.virtualizationCustomItemHeight} />
|
||||
> **Note**: If the height of the list items differs from the default due to `startContent` or other custom content, be sure to pass the correct value to `itemHeight` to prevent layout issues.
|
||||
|
||||
<CodeDemo title="Custom Item Height" files={selectContent.virtualizationCustomItemHeight} />
|
||||
|
||||
### With Sections
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user