zero-dependency-bottom-sheet
Version:
A zero-dependency, customizable React bottom sheet component with drag gestures, snap points, and TypeScript support
20 lines (19 loc) • 759 B
TypeScript
import React, { Dispatch, SetStateAction } from "react";
interface UseDragging {
height: number;
setHeight: Dispatch<SetStateAction<number>>;
onClose: () => void;
turningPoint: number | undefined;
startSpringAnimation: (height: number) => void;
snapPoints?: number[];
isOpen: boolean;
initialHeight: number | undefined;
}
declare function useDragging({ height, setHeight, onClose, turningPoint, startSpringAnimation, snapPoints, isOpen, initialHeight, }: UseDragging): {
handleDragStart: (e: React.MouseEvent | React.TouchEvent) => void;
isDragging: boolean;
dragRef: React.RefObject<HTMLDivElement>;
headerHeight: number;
bottomSheetBodyRef: React.RefObject<HTMLDivElement>;
};
export default useDragging;