Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions packages/rn-tester/js/examples/Pressable/PressableExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,23 @@ function PressableDisabled() {
);
}

function RoundedPressableExample() {
return (
<View>
<Pressable
android_ripple={{color: 'red', borderless: false}}
style={styles.roundedPressable}>
<Text style={{alignSelf: 'center'}}>Background Ripple</Text>
</Pressable>
<Pressable
android_ripple={{color: 'red', borderless: false, foreground: true}}
style={styles.roundedPressable}>
<Text style={{alignSelf: 'center'}}>Foreground Ripple</Text>
</Pressable>
</View>
);
}

const styles = StyleSheet.create({
row: {
justifyContent: 'center',
Expand Down Expand Up @@ -397,6 +414,12 @@ const styles = StyleSheet.create({
height: 100,
width: 100,
},
roundedPressable: {
backgroundColor: '#eee',
borderRadius: 100,
padding: 16,
marginTop: 10,
},
});

const examples = [
Expand Down Expand Up @@ -714,6 +737,15 @@ const examples = [
);
},
},
{
title: 'Rounded Pressable with Ripple',
description:
'Ripple should clip to the border radius of the Pressable' as string,
platform: 'android',
render: function (): React.Node {
return <RoundedPressableExample />;
},
},
...PressableExampleFbInternal.examples,
];

Expand Down
Loading