Theia API Documentation v1.65.0
    Preparing search index...

    Representation of the tree view properties.

    interface ViewProps {
        alignToBottom?: boolean;
        atBottomStateChange?: (atBottom: boolean) => void;
        atBottomThreshold?: number;
        atTopStateChange?: (atTop: boolean) => void;
        atTopThreshold?: number;
        components?: Components<unknown>;
        computeItemKey?: ComputeItemKey<unknown, unknown>;
        context?: unknown;
        customScrollParent?: HTMLElement;
        data?: readonly unknown[];
        defaultItemHeight?: number;
        endReached?: (index: number) => void;
        firstItemIndex?: number;
        fixedItemHeight?: number;
        followOutput?: FollowOutput;
        headerFooterTag?: string;
        height: number;
        increaseViewportBy?: number | { bottom: number; top: number };
        initialItemCount?: number;
        initialScrollTop?: number;
        initialTopMostItemIndex?: number | IndexLocationWithAlign;
        isScrolling?: (isScrolling: boolean) => void;
        itemContent?: ItemContent<unknown, unknown>;
        itemSize?: SizeFunction;
        itemsRendered?: (items: ListItem<unknown>[]) => void;
        onScrollEmitter?: Emitter<TreeScrollEvent>;
        overscan?: number | { main: number; reverse: number };
        rangeChanged?: (range: ListRange) => void;
        react18ConcurrentRendering?: boolean;
        renderNodeRow: (row: NodeRow) => ReactNode;
        rows: NodeRow[];
        scrollerRef?: (ref: null | HTMLElement | Window) => any;
        scrollSeekConfiguration?: false | ScrollSeekConfiguration;
        scrollToRow?: number;
        startReached?: (index: number) => void;
        topItemCount?: number;
        totalCount?: number;
        totalListHeightChanged?: (height: number) => void;
        useWindowScroll?: boolean;
        width: number;
        [key: string]: HTMLProps<"div">;
        [key: number]: HTMLProps<"div">;
        [key: symbol]: HTMLProps<"div">;
    }

    Hierarchy

    • VirtuosoProps<unknown, unknown>
      • ViewProps

    Indexable

    • [key: string]: HTMLProps<"div">
    • [key: number]: HTMLProps<"div">
    • [key: symbol]: HTMLProps<"div">
    Index

    Properties

    alignToBottom?: boolean

    Setting alignToBottom to true aligns the items to the bottom of the list if the list is shorter than the viewport. Use followOutput property to keep the list aligned when new items are appended.

    atBottomStateChange?: (atBottom: boolean) => void

    Called with true / false when the list has reached the bottom / gets scrolled up. Can be used to load newer items, like tail -f.

    atBottomThreshold?: number

    The property accepts pixel values.

    By default 4. Redefine to change how much away from the bottom the scroller can be before the list is not considered not at bottom.

    atTopStateChange?: (atTop: boolean) => void

    Called with true / false when the list has reached the top / gets scrolled down.

    atTopThreshold?: number

    The property accepts pixel values.

    By default 0. Redefine to change how much away from the top the scroller can be before the list is not considered not at top.

    components?: Components<unknown>

    Use the components property for advanced customization of the elements rendered by the list.

    computeItemKey?: ComputeItemKey<unknown, unknown>

    If specified, the component will use the function to generate the key property for each list item.

    context?: unknown

    Additional context available in the custom components and content callbacks

    customScrollParent?: HTMLElement

    Pass a reference to a scrollable parent element, so that the list won't wrap in its own.

    data?: readonly unknown[]

    The data items to be rendered. If data is set, the total count will be inferred from the length of the array.

    defaultItemHeight?: number

    By default, the component assumes the default item height from the first rendered item (rendering it as a "probe").

    If the first item turns out to be an outlier (very short or tall), the rest of the rendering will be slower, as multiple passes of rendering should happen for the list to fill the viewport.

    Setting defaultItemHeight causes the component to skip the "probe" rendering and use the property value as default height instead.

    endReached?: (index: number) => void

    Gets called when the user scrolls to the end of the list. Receives the last item index as an argument. Can be used to implement endless scrolling.

    firstItemIndex?: number

    Use when implementing inverse infinite scrolling - decrease the value this property in combination with data or totalCount to prepend items to the top of the list.

    Warning: the firstItemIndex should be a positive number, based on the total amount of items to be displayed.

    fixedItemHeight?: number

    Can be used to improve performance if the rendered items are of known size. Setting it causes the component to skip item measurements.

    followOutput?: FollowOutput

    If set to true, the list automatically scrolls to bottom if the total count is changed. Set to "smooth" for an animated scrolling.

    By default, followOutput scrolls down only if the list is already at the bottom. To implement an arbitrary logic behind that, pass a function:

    <Virtuoso
    followOutput={(isAtBottom: boolean) => {
    if (expression) {
    return 'smooth' // can be 'auto' or false to avoid scrolling
    } else {
    return false
    }
    }} />
    headerFooterTag?: string

    Set to customize the wrapper tag for the header and footer components (default is div).

    height: number

    The height property.

    increaseViewportBy?: number | { bottom: number; top: number }

    The property accepts pixel values.

    Set the increaseViewportBy property to artificially increase the viewport size, causing items to be rendered before outside of the viewport. The property causes the component to render more items than the necessary, but can help with slow loading content. Using { top?: number, bottom?: number } lets you set the increase for each end separately.

    initialItemCount?: number

    Use for server-side rendering - if set, the list will render the specified amount of items regardless of the container / item size.

    initialScrollTop?: number

    Set this value to offset the initial location of the list. Warning: using this property will still run a render cycle at the scrollTop: 0 list window. If possible, avoid using it and stick to initialTopMostItemIndex instead.

    initialTopMostItemIndex?: number | IndexLocationWithAlign

    Set to a value between 0 and totalCount - 1 to make the list start scrolled to that item. Pass in an object to achieve additional effects similar to scrollToIndex.

    isScrolling?: (isScrolling: boolean) => void

    Called when the list starts/stops scrolling.

    itemContent?: ItemContent<unknown, unknown>

    Set the callback to specify the contents of the item.

    itemSize?: SizeFunction

    Allows customizing the height/width calculation of Item elements.

    The default implementation reads el.getBoundingClientRect().height and el.getBoundingClientRect().width.

    itemsRendered?: (items: ListItem<unknown>[]) => void

    Called with the new set of items each time the list items are rendered due to scrolling.

    onScrollEmitter?: Emitter<TreeScrollEvent>

    Optional scroll event emitter.

    overscan?: number | { main: number; reverse: number }

    The property accepts pixel values.

    Set the overscan property to make the component "chunk" the rendering of new items on scroll. The property causes the component to render more items than the necessary, but reduces the re-renders on scroll. Setting { main: number, reverse: number } lets you extend the list in both the main and the reverse scrollable directions. See the increaseViewportBy property for a similar behavior (equivalent to the overscan in react-window).

    rangeChanged?: (range: ListRange) => void

    Called with the new set of items each time the list items are rendered due to scrolling.

    react18ConcurrentRendering?: boolean

    No longer necessary after 2.10.2. component should work out of the box.

    renderNodeRow: (row: NodeRow) => ReactNode
    rows: NodeRow[]

    The list of node rows.

    scrollerRef?: (ref: null | HTMLElement | Window) => any

    Provides access to the root DOM element

    scrollSeekConfiguration?: false | ScrollSeekConfiguration

    Use to display placeholders if the user scrolls fast through the list.

    Set components.ScrollSeekPlaceholder to change the placeholder content.

    scrollToRow?: number

    The scroll to row value.

    startReached?: (index: number) => void

    Called when the user scrolls to the start of the list.

    topItemCount?: number

    Set the amount of items to remain fixed at the top of the list.

    For a header that scrolls away when scrolling, check the components.Header property.

    totalCount?: number

    The total amount of items to be rendered.

    totalListHeightChanged?: (height: number) => void

    Called when the total list height is changed due to new items or viewport resize.

    useWindowScroll?: boolean

    Uses the document scroller rather than wrapping the list in its own.

    width: number

    The width property.