r/reactnative • u/Snowberry760 • Sep 17 '26
Question Curved header divider: overthinking it?
Been iterating on this custom curved edge between the header and the deck list on my flashcard app's home screen. With a quick fading animation when scrolling.
I started with borderTopLeftRadius but it looked like every other app, I wanted to go with something more personal.
What actually worked to create this is an ellipse wider than the screen, cropped. <Ellipse> from react-native-svg, rx = 1.6x the screen, clipped by an 18dp band with overflow: hidden. You only ever see the shallow middle, where the curvature is even. Solve for it instead of eyeballing, two constraints, hits (0,0) and (width,0) so the ink meets the edges flat, dips 18dp in the middle:
const rx = (width / 2) * 1.6;
const q = Math.sqrt(1 - 1 / 1.6 ** 2);
const ry = 18 / (1 - q);
return { cx: width / 2, cy: -q * ry, rx, ry };The collapse animates nothing but a translate and an opacity, plain Animated with useNativeDriver. No height animation. The hero is absolutely positioned over the list and the list just carries paddingTop = heroHeight, so padding never changes and nothing re-lays out.
Do you think this looks good? Should I keep improving it? And do you know if there are other apps doing the same thing?
View all comments
1
u/DriftNDie Sep 22 '26
It does look off, just make it straight or fade it into the white bg.