Back to docs
Animation
Swipe Dismiss
Swipe-to-dismiss wrapper with threshold callback.
Install
npx shadcn@latest add @native-bits/swipe-dismissDependencies
react-native-reanimatedreact-native-gesture-handler
animationgesturemobile
Props
| Prop | Type | Default | Description |
|---|---|---|---|
| children | ReactNode | - | Dismissable content |
| threshold | number | 80 | Dismiss threshold in px |
| onDismiss | () => void | - | Dismiss callback |
Usage
```tsx
import { swipe-dismiss } from '@/components/native-bits/swipe-dismiss'
<SwipeDismiss onDismiss={removeItem}>
<InboxCard />
</SwipeDismiss>
```Source code
Loading...