@chayns-components/swipeable-wrapper
Version:
A set of beautiful React components for developing your own applications with chayns.
42 lines (41 loc) • 1.17 kB
TypeScript
import { CSSProperties, FC, ReactNode } from 'react';
export type SwipeableActionItem = {
action: VoidFunction;
backgroundColor: CSSProperties['backgroundColor'];
color: CSSProperties['color'];
text?: ReactNode;
icon: ReactNode;
key: string;
};
export type SwipeableWrapperProps = {
/**
* The content of the Swipeable item.
*/
children: ReactNode;
/**
* The left-side actions, ordered from the left to the right.
*/
leftActions?: SwipeableActionItem[];
/**
* The right-side actions, ordered from left to the right.
*/
rightActions?: SwipeableActionItem[];
/**
* Whether the opacity should be animated when swiping in the actions.
*/
shouldUseOpacityAnimation?: boolean;
/**
* Whether the swipeable functionality is disabled
*/
isDisabled?: boolean;
/**
* Callback to be executed when the swiping is started.
*/
onSwipeStart?: VoidFunction;
/**
* Callback to be executed when the swiping is ended.
*/
onSwipeEnd?: VoidFunction;
};
declare const SwipeableWrapper: FC<SwipeableWrapperProps>;
export default SwipeableWrapper;