Skip to content

Commit 6d5f940

Browse files
authored
Add android ripple props to pressable (#862)
1 parent deef076 commit 6d5f940

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

packages/core/src/components/Pressable.tsx

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ type Props = {
99
style?: ViewStyle;
1010
activeOpacity?: number;
1111
disabledOpacity?: number;
12-
} & PressableProps;
12+
androidRippleColor?: string;
13+
androidRippleBorderless?: boolean;
14+
androidRippleRadius?: number;
15+
androidRippleForeground?: boolean;
16+
} & Omit<PressableProps, "android_ripple ">;
1317

1418
export default function Pressable({
1519
children,
@@ -19,6 +23,10 @@ export default function Pressable({
1923
disabledOpacity = 0.8,
2024
delayLongPress,
2125
hitSlop,
26+
androidRippleColor,
27+
androidRippleBorderless,
28+
androidRippleRadius,
29+
androidRippleForeground,
2230
style,
2331
...props
2432
}: Props) {
@@ -36,6 +44,19 @@ export default function Pressable({
3644
style,
3745
];
3846
}}
47+
android_ripple={
48+
androidRippleColor ||
49+
androidRippleBorderless ||
50+
androidRippleColor ||
51+
androidRippleForeground
52+
? {
53+
radius: androidRippleRadius,
54+
borderless: androidRippleBorderless,
55+
color: androidRippleColor,
56+
foreground: androidRippleForeground,
57+
}
58+
: null
59+
}
3960
{...props}
4061
>
4162
{children}

0 commit comments

Comments
 (0)