feat(VirtualList): add isLoading prop

This commit is contained in:
Ilia Mashkov
2026-02-06 11:55:05 +03:00
parent 51c2b6b5da
commit e4aacf609e

View File

@@ -101,13 +101,25 @@ interface Props {
* @template T - The type of items in the list * @template T - The type of items in the list
*/ */
children: Snippet< children: Snippet<
[{ item: T; index: number; isFullyVisible: boolean; isPartiallyVisible: boolean; proximity: number }] [
{
item: T;
index: number;
isFullyVisible: boolean;
isPartiallyVisible: boolean;
proximity: number;
},
]
>; >;
/** /**
* Whether to use the window as the scroll container. * Whether to use the window as the scroll container.
* @default false * @default false
*/ */
useWindowScroll?: boolean; useWindowScroll?: boolean;
/**
* Flag to show loading state
*/
isLoading?: boolean;
} }
let { let {
@@ -120,6 +132,7 @@ let {
onNearBottom, onNearBottom,
children, children,
useWindowScroll = false, useWindowScroll = false,
isLoading = false,
}: Props = $props(); }: Props = $props();
// Reference to the ScrollArea viewport element for attaching the virtualizer // Reference to the ScrollArea viewport element for attaching the virtualizer