UNPKG

react-virtualized-sticky-tree

Version:

A React component for efficiently rendering tree like structures with support for position: sticky

12 lines (11 loc) 821 B
import React from 'react'; import StickyTree, { StickyTreeNode, StickyTreeProps, TreeNode } from './StickyTree.js'; type OmitProps = 'getChildren' | 'root' | 'renderRoot'; export type StickyListNode = TreeNode & Pick<StickyTreeNode, 'zIndex' | 'isSticky' | 'stickyTop' | 'height'>; export interface StickyListProps<TNodeType extends TreeNode = TreeNode, TMeta = any> extends Omit<StickyTreeProps<TNodeType, TMeta>, OmitProps> { items: TNodeType[]; getRowHeight?: (item: TNodeType) => number; treeRef?: React.Ref<StickyTree<TNodeType, TMeta>>; } declare const StickyList: <TNodeType extends StickyListNode = StickyListNode, TMeta = any>({ items, rowRenderer, width, height, treeRef, getRowHeight, wrapAllLeafNodes, ...rest }: StickyListProps<TNodeType, TMeta>) => React.JSX.Element; export default StickyList;