Components
iOSAndroid
Installation
pnpm dlx @docyrus/cli add @docyrus/rn-pressable-feedbackRequired Packages(1 package)
pnpm add react-native-reanimatedUsage
import { PressableFeedback } from '@/components/docyrus-native/pressable-feedback';
<PressableFeedback onPress={() => console.log('pressed')}>
<Text>Press me</Text>
</PressableFeedback>API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | — | Content to wrap |
feedbackVariant | 'scale' | 'scale-highlight' | 'none' | 'scale-highlight' | Type of press feedback |
scaleValue | number | 0.97 | Scale factor on press |
highlightOpacity | number | 0.7 | Opacity on press (scale-highlight only) |
disabled | boolean | false | Disable interactions |
className | string | — | Additional classes |
All PressableProps are also accepted.
Type Exports
| Type | Description |
|---|---|
PressableFeedbackProps | Props for PressableFeedback |
FeedbackVariant | 'scale' | 'scale-highlight' | 'none' |