virtua
Version:
A zero-config, fast and small (~3kB) virtual list (and grid) component for React, Vue, Solid and Svelte.
24 lines (23 loc) • 939 B
TypeScript
import { ReactElement, Ref } from "react";
import { ViewportComponentAttributes } from "./types.js";
import { VirtualizerHandle, VirtualizerProps } from "./Virtualizer.js";
/**
* Methods of {@link VList}.
*/
export interface VListHandle extends VirtualizerHandle {
}
/**
* Props of {@link VList}.
*/
export interface VListProps<T = unknown> extends Pick<VirtualizerProps<T>, "children" | "data" | "bufferSize" | "itemSize" | "shift" | "horizontal" | "cache" | "ssrCount" | "item" | "onScroll" | "onScrollEnd" | "keepMounted">, ViewportComponentAttributes {
/**
* 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.
*/
reverse?: boolean;
}
/**
* Virtualized list component. See {@link VListProps} and {@link VListHandle}.
*/
export declare const VList: <T>(props: VListProps<T> & {
ref?: Ref<VListHandle>;
}) => ReactElement;