Props of VList.
Pick
<VirtualizerProps
,"children"
|"count"
|"overscan"
|"itemSize"
|"shift"
|"horizontal"
|"cache"
|"ssrCount"
|"item"
|"onScroll"
|"onScrollEnd"
|"keepMounted"
>.ViewportComponentAttributes
optional
reverse:boolean
If true, items are aligned to the end of the list when total size of items are smaller than viewport size. It's useful for chat like app.
children:
ReactNode
| (index
) =>ReactElement
<any
, string | JSXElementConstructor<any>>
Elements rendered by this component.
You can also pass a function and set VirtualizerProps.count to create elements lazily.
Pick.children
optional
onScroll: (offset
) =>void
Callback invoked whenever scroll offset changes.
number
Current scrollTop, or scrollLeft if horizontal: true.
void
Pick.onScroll
optional
shift:boolean
While true is set, scroll position will be maintained from the end not usual start when items are added to/removed from start. It's recommended to set false if you add to/remove from mid/end of the list because it can cause unexpected behavior. This prop is useful for reverse infinite scrolling.
Pick.shift
optional
count:number
If you set a function to VirtualizerProps.children, you have to set total number of items to this prop.
Pick.count
optional
overscan:number
Number of items to render above/below the visible bounds of the list. Lower value will give better performance but you can increase to avoid showing blank items in fast scrolling.
4
Pick.overscan
optional
itemSize:number
Item size hint for unmeasured items. It will help to reduce scroll jump when items are measured if used properly.
- If not set, initial item sizes will be automatically estimated from measured sizes. This is recommended for most cases.
- If set, you can opt out estimation and use the value as initial item size.
Pick.itemSize
optional
horizontal:boolean
If true, rendered as a horizontally scrollable list. Otherwise rendered as a vertically scrollable list.
Pick.horizontal
optional
keepMounted:number
[]
List of indexes that should be always mounted, even when off screen.
Pick.keepMounted
optional
cache:CacheSnapshot
You can restore cache by passing a CacheSnapshot on mount. This is useful when you want to restore scroll position after navigation. The snapshot can be obtained from VirtualizerHandle.cache.
The length of items should be the same as when you take the snapshot, otherwise restoration may not work as expected.
Pick.cache
optional
ssrCount:number
A prop for SSR. If set, the specified amount of items will be mounted in the initial rendering regardless of the container size until hydrated.
Pick.ssrCount
optional
item:CustomItemComponent
| keyof IntrinsicElements
Component or element type for item element. This component will get CustomItemComponentProps as props.
"div"
Pick.item
optional
onScrollEnd: () =>void
Callback invoked when scrolling stops.
void
Pick.onScrollEnd
optional
className:string
ViewportComponentAttributes.className
node_modules/@types/react/index.d.ts:2904
optional
style:CSSProperties
ViewportComponentAttributes.style
node_modules/@types/react/index.d.ts:2916
optional
id:string
ViewportComponentAttributes.id
node_modules/@types/react/index.d.ts:2911
optional
role:AriaRole
ViewportComponentAttributes.role
node_modules/@types/react/index.d.ts:2925
optional
tabIndex:number
ViewportComponentAttributes.tabIndex
node_modules/@types/react/index.d.ts:2917
optional
onKeyDown:KeyboardEventHandler
<HTMLElement
>
ViewportComponentAttributes.onKeyDown
node_modules/@types/react/index.d.ts:2435
optional
onWheel:WheelEventHandler
<HTMLElement
>
ViewportComponentAttributes.onWheel
node_modules/@types/react/index.d.ts:2569
optional
aria-activedescendant:string
Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application.
ViewportComponentAttributes.aria-activedescendant
node_modules/@types/react/index.d.ts:2599
optional
aria-atomic:Booleanish
Indicates whether assistive technologies will present all, or only parts of, the changed region based on the change notifications defined by the aria-relevant attribute.
ViewportComponentAttributes.aria-atomic
node_modules/@types/react/index.d.ts:2601
optional
aria-autocomplete:"inline"
|"none"
|"both"
|"list"
Indicates whether inputting text could trigger display of one or more predictions of the user's intended value for an input and specifies how predictions would be presented if they are made.
ViewportComponentAttributes.aria-autocomplete
node_modules/@types/react/index.d.ts:2606
optional
aria-braillelabel:string
Defines a string value that labels the current element, which is intended to be converted into Braille.
aria-label.
ViewportComponentAttributes.aria-braillelabel
node_modules/@types/react/index.d.ts:2612
optional
aria-brailleroledescription:string
Defines a human-readable, author-localized abbreviated description for the role of an element, which is intended to be converted into Braille.
aria-roledescription.
ViewportComponentAttributes.aria-brailleroledescription
node_modules/@types/react/index.d.ts:2617
optional
aria-busy:Booleanish
ViewportComponentAttributes.aria-busy
node_modules/@types/react/index.d.ts:2618
optional
aria-checked:boolean
|"mixed"
|"false"
|"true"
Indicates the current "checked" state of checkboxes, radio buttons, and other widgets.
- aria-pressed
- aria-selected.
ViewportComponentAttributes.aria-checked
node_modules/@types/react/index.d.ts:2623
optional
aria-colcount:number
Defines the total number of columns in a table, grid, or treegrid.
aria-colindex.
ViewportComponentAttributes.aria-colcount
node_modules/@types/react/index.d.ts:2628
optional
aria-colindex:number
Defines an element's column index or position with respect to the total number of columns within a table, grid, or treegrid.
- aria-colcount
- aria-colspan.
ViewportComponentAttributes.aria-colindex
node_modules/@types/react/index.d.ts:2633
optional
aria-colindextext:string
Defines a human readable text alternative of aria-colindex.
aria-rowindextext.
ViewportComponentAttributes.aria-colindextext
node_modules/@types/react/index.d.ts:2638
optional
aria-colspan:number
Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid.
- aria-colindex
- aria-rowspan.
ViewportComponentAttributes.aria-colspan
node_modules/@types/react/index.d.ts:2643
optional
aria-controls:string
Identifies the element (or elements) whose contents or presence are controlled by the current element.
aria-owns.
ViewportComponentAttributes.aria-controls
node_modules/@types/react/index.d.ts:2648
optional
aria-current:boolean
|"time"
|"page"
|"false"
|"true"
|"location"
|"date"
|"step"
Indicates the element that represents the current item within a container or set of related elements.
ViewportComponentAttributes.aria-current
node_modules/@types/react/index.d.ts:2650
optional
aria-describedby:string
Identifies the element (or elements) that describes the object.
aria-labelledby
ViewportComponentAttributes.aria-describedby
node_modules/@types/react/index.d.ts:2655
optional
aria-description:string
Defines a string value that describes or annotates the current element.
related aria-describedby.
ViewportComponentAttributes.aria-description
node_modules/@types/react/index.d.ts:2660
optional
aria-details:string
Identifies the element that provides a detailed, extended description for the object.
aria-describedby.
ViewportComponentAttributes.aria-details
node_modules/@types/react/index.d.ts:2665
optional
aria-disabled:Booleanish
Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable.
- aria-hidden
- aria-readonly.
ViewportComponentAttributes.aria-disabled
node_modules/@types/react/index.d.ts:2670
optional
aria-dropeffect:"copy"
|"none"
|"link"
|"move"
|"execute"
|"popup"
Indicates what functions can be performed when a dragged object is released on the drop target.
in ARIA 1.1
ViewportComponentAttributes.aria-dropeffect
node_modules/@types/react/index.d.ts:2675
optional
aria-errormessage:string
Identifies the element that provides an error message for the object.
- aria-invalid
- aria-describedby.
ViewportComponentAttributes.aria-errormessage
node_modules/@types/react/index.d.ts:2680
optional
aria-expanded:Booleanish
Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed.
ViewportComponentAttributes.aria-expanded
node_modules/@types/react/index.d.ts:2682
optional
aria-flowto:string
Identifies the next element (or elements) in an alternate reading order of content which, at the user's discretion, allows assistive technology to override the general default of reading in document source order.
ViewportComponentAttributes.aria-flowto
node_modules/@types/react/index.d.ts:2687
optional
aria-grabbed:Booleanish
Indicates an element's "grabbed" state in a drag-and-drop operation.
in ARIA 1.1
ViewportComponentAttributes.aria-grabbed
node_modules/@types/react/index.d.ts:2692
optional
aria-haspopup:boolean
|"grid"
|"dialog"
|"menu"
|"listbox"
|"false"
|"true"
|"tree"
Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element.
ViewportComponentAttributes.aria-haspopup
node_modules/@types/react/index.d.ts:2694
aria-hidden?
optional
aria-hidden:Booleanish
Indicates whether the element is exposed to an accessibility API.
aria-disabled.
ViewportComponentAttributes.aria-hidden
node_modules/@types/react/index.d.ts:2699
optional
aria-invalid:boolean
|"false"
|"true"
|"grammar"
|"spelling"
Indicates the entered value does not conform to the format expected by the application.
aria-errormessage.
ViewportComponentAttributes.aria-invalid
node_modules/@types/react/index.d.ts:2704
optional
aria-keyshortcuts:string
Indicates keyboard shortcuts that an author has implemented to activate or give focus to an element.
ViewportComponentAttributes.aria-keyshortcuts
node_modules/@types/react/index.d.ts:2706
optional
aria-label:string
Defines a string value that labels the current element.
aria-labelledby.
ViewportComponentAttributes.aria-label
node_modules/@types/react/index.d.ts:2711
optional
aria-labelledby:string
Identifies the element (or elements) that labels the current element.
aria-describedby.
ViewportComponentAttributes.aria-labelledby
node_modules/@types/react/index.d.ts:2716
optional
aria-level:number
Defines the hierarchical level of an element within a structure.
ViewportComponentAttributes.aria-level
node_modules/@types/react/index.d.ts:2718
optional
aria-live:"off"
|"assertive"
|"polite"
Indicates that an element will be updated, and describes the types of updates the user agents, assistive technologies, and user can expect from the live region.
ViewportComponentAttributes.aria-live
node_modules/@types/react/index.d.ts:2720
optional
aria-modal:Booleanish
Indicates whether an element is modal when displayed.
ViewportComponentAttributes.aria-modal
node_modules/@types/react/index.d.ts:2722
optional
aria-multiline:Booleanish
Indicates whether a text box accepts multiple lines of input or only a single line.
ViewportComponentAttributes.aria-multiline
node_modules/@types/react/index.d.ts:2724
optional
aria-multiselectable:Booleanish
Indicates that the user may select more than one item from the current selectable descendants.
ViewportComponentAttributes.aria-multiselectable
node_modules/@types/react/index.d.ts:2726
optional
aria-orientation:"horizontal"
|"vertical"
Indicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous.
ViewportComponentAttributes.aria-orientation
node_modules/@types/react/index.d.ts:2728
optional
aria-owns:string
Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship between DOM elements where the DOM hierarchy cannot be used to represent the relationship.
aria-controls.
ViewportComponentAttributes.aria-owns
node_modules/@types/react/index.d.ts:2734
optional
aria-placeholder:string
Defines a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value. A hint could be a sample value or a brief description of the expected format.
ViewportComponentAttributes.aria-placeholder
node_modules/@types/react/index.d.ts:2739
optional
aria-posinset:number
Defines an element's number or position in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.
aria-setsize.
ViewportComponentAttributes.aria-posinset
node_modules/@types/react/index.d.ts:2744
optional
aria-pressed:boolean
|"mixed"
|"false"
|"true"
Indicates the current "pressed" state of toggle buttons.
- aria-checked
- aria-selected.
ViewportComponentAttributes.aria-pressed
node_modules/@types/react/index.d.ts:2749
optional
aria-readonly:Booleanish
Indicates that the element is not editable, but is otherwise operable.
aria-disabled.
ViewportComponentAttributes.aria-readonly
node_modules/@types/react/index.d.ts:2754
optional
aria-relevant:"text"
|"all"
|"additions"
|"additions removals"
|"additions text"
|"removals"
|"removals additions"
|"removals text"
|"text additions"
|"text removals"
Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified.
aria-atomic.
ViewportComponentAttributes.aria-relevant
node_modules/@types/react/index.d.ts:2759
optional
aria-required:Booleanish
Indicates that user input is required on the element before a form may be submitted.
ViewportComponentAttributes.aria-required
node_modules/@types/react/index.d.ts:2772
optional
aria-roledescription:string
Defines a human-readable, author-localized description for the role of an element.
ViewportComponentAttributes.aria-roledescription
node_modules/@types/react/index.d.ts:2774
optional
aria-rowcount:number
Defines the total number of rows in a table, grid, or treegrid.
aria-rowindex.
ViewportComponentAttributes.aria-rowcount
node_modules/@types/react/index.d.ts:2779
optional
aria-rowindex:number
Defines an element's row index or position with respect to the total number of rows within a table, grid, or treegrid.
- aria-rowcount
- aria-rowspan.
ViewportComponentAttributes.aria-rowindex
node_modules/@types/react/index.d.ts:2784
optional
aria-rowindextext:string
Defines a human readable text alternative of aria-rowindex.
aria-colindextext.
ViewportComponentAttributes.aria-rowindextext
node_modules/@types/react/index.d.ts:2789
optional
aria-rowspan:number
Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid.
- aria-rowindex
- aria-colspan.
ViewportComponentAttributes.aria-rowspan
node_modules/@types/react/index.d.ts:2794
optional
aria-selected:Booleanish
Indicates the current "selected" state of various widgets.
- aria-checked
- aria-pressed.
ViewportComponentAttributes.aria-selected
node_modules/@types/react/index.d.ts:2799
optional
aria-setsize:number
Defines the number of items in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM.
aria-posinset.
ViewportComponentAttributes.aria-setsize
node_modules/@types/react/index.d.ts:2804
optional
aria-sort:"none"
|"ascending"
|"descending"
|"other"
Indicates if items in a table or grid are sorted in ascending or descending order.
ViewportComponentAttributes.aria-sort
node_modules/@types/react/index.d.ts:2806
optional
aria-valuemax:number
Defines the maximum allowed value for a range widget.
ViewportComponentAttributes.aria-valuemax
node_modules/@types/react/index.d.ts:2808
optional
aria-valuemin:number
Defines the minimum allowed value for a range widget.
ViewportComponentAttributes.aria-valuemin
node_modules/@types/react/index.d.ts:2810
optional
aria-valuenow:number
Defines the current value for a range widget.
aria-valuetext.
ViewportComponentAttributes.aria-valuenow
node_modules/@types/react/index.d.ts:2815
optional
aria-valuetext:string
Defines the human readable text alternative of aria-valuenow for a range widget.
ViewportComponentAttributes.aria-valuetext
node_modules/@types/react/index.d.ts:2817