react-snaplist-carousel
Version:
A light, pure React, no dependencies and flexible carousel. A modern way to do a classic thing.
10 lines (9 loc) • 419 B
TypeScript
import { RefObject } from 'react';
export declare const getVisibleChildren: ($viewport?: HTMLDivElement | null | undefined) => {
children: number[];
childrenInCenter: number | null;
};
export declare const useVisibleElements: <T>({ debounce, ref, }: {
ref: RefObject<HTMLDivElement>;
debounce?: number | undefined;
}, selector: (elements: number[], childrenInCenter: number | null) => T) => T;