Skip to content

Pressable

Pressable wraps the headless usePressable hook with gesture-driven feedback on the UI thread.

import { Pressable } from '@truongdq01/ui';
import { Text, View } from 'react-native';
<Pressable onPress={() => {}} feedbackMode="scale">
{({ isPressed }) => (
<View style={{ padding: 16, opacity: isPressed ? 0.8 : 1 }}>
<Text>Tap me</Text>
</View>
)}
</Pressable>;
PropTypeDefaultDescription
childrenReactNode or render function-Content or render function
styleobject or object[]-Style passed to the animated view
onPress() => void-Press handler
onLongPress() => void-Long press handler
longPressMinDurationnumber500Long press minimum duration (ms)
disabledbooleanfalseDisable interaction
feedbackMode"scale", "scaleSubtle", "opacity", "none""scale"Visual feedback style
accessibilityLabelstring-Accessibility label
accessibilityHintstring-Accessibility hint
accessibilityRoleAccessibilityRole"button"Accessibility role
hapticbooleantrueEnable haptic feedback