@chayns-components/swipeable-wrapper
Version:
A set of beautiful React components for developing your own applications with chayns.
34 lines (33 loc) • 957 B
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;
};
declare const SwipeableWrapper: FC<SwipeableWrapperProps>;
export default SwipeableWrapper;