Skip to content

Commit d562ae6

Browse files
chore: add border radius example
1 parent d3a3505 commit d562ae6

1 file changed

Lines changed: 35 additions & 0 deletions

File tree

example/src/App.tsx

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,27 @@ function CustomEasingDemo() {
345345
);
346346
}
347347

348+
function BorderRadiusDemo() {
349+
const [expanded, setExpanded] = useState(false);
350+
return (
351+
<Section title="Border Radius">
352+
<EaseView
353+
animate={{ borderRadius: expanded ? 0 : 40 }}
354+
transition={{ type: 'spring', damping: 15, stiffness: 120, mass: 1 }}
355+
style={styles.borderRadiusBox}
356+
>
357+
<Text style={styles.borderRadiusText}>
358+
{expanded ? 'Square' : 'Round'}
359+
</Text>
360+
</EaseView>
361+
<Button
362+
label={expanded ? 'Round' : 'Square'}
363+
onPress={() => setExpanded((v) => !v)}
364+
/>
365+
</Section>
366+
);
367+
}
368+
348369
function CombinedDemo() {
349370
const [active, setActive] = useState(false);
350371
return (
@@ -387,6 +408,7 @@ function DemosScreen() {
387408
<IndependentScaleDemo />
388409
<TransformOriginDemo />
389410
<StyledCardDemo />
411+
<BorderRadiusDemo />
390412
<CustomEasingDemo />
391413
<CombinedDemo />
392414
</ScrollView>
@@ -530,6 +552,19 @@ const styles = StyleSheet.create({
530552
fontWeight: '700',
531553
letterSpacing: 1,
532554
},
555+
borderRadiusBox: {
556+
width: 80,
557+
height: 80,
558+
backgroundColor: '#4a90d9',
559+
alignItems: 'center',
560+
justifyContent: 'center',
561+
overflow: 'hidden',
562+
},
563+
borderRadiusText: {
564+
color: '#fff',
565+
fontSize: 13,
566+
fontWeight: '700',
567+
},
533568
styledCard: {
534569
opacity: 0.6,
535570
backgroundColor: '#2a2a4a',

0 commit comments

Comments
 (0)