Fluid Lit Morphing Shader Card
A deep indigo card is lit from its edges by pale violet light while blue-violet areas drift around a dark core. It morphs between wide, small square, tall and square shapes on a measured curve. WebGL and Skia share one SkSL shader.
export function Example() {
const progress = useSharedValue(0);
…
Agent prompt
Add the Now In Code component "fluid-lit-morphing-shader-card" to this project. The full source is attached at the end of this prompt. Put the files under components/fluid-lit-morphing-shader-card/, install the listed dependencies with `npx expo install`, and render it on a route I can open. Keep the timing and easing values documented in the source comments. Replace the sample copy and artwork with content from my app, or leave placeholders and list what I still need to supply. === Source files are attached here for paid plans ===
Details
- Platforms
- iOS, Android, Web
- Requires
- Expo SDK 54+
- Access
- Pro
- Updated
- 7 Oct 2026
- License
- Unlimited commercial projects
- Original design
- @insporadesign on X
Are you the designer? Ask us to change or remove this.
Add pieces from the terminal or let your agent fetch them. Until then, Copy prompt does the same job. Docs
What it does
A rounded card on a pale background filled with a dark navy fluid lit from its edges. A lavender glow reaches in from all four sides, blue and violet patches drift through the interior, and a thin white rim closes the shape. The card can be any size, and the glow reach and patch scale follow the dimensions, so the same fill works for a small chip or a large panel. A demo loop morphs the card between a wide card, a small square, a tall card and a larger square, keeping its centre fixed. Content can be placed inside as children, or the card can be used purely as a background. A time prop freezes a frame.
How it's built
A single Skia runtime effect draws the whole card, using the same shader body and timeline as the WebGL browser preview. A rounded-rectangle distance field gives coverage and the rim. Edge depth comes from exponential falloff on each side, and three flowing fields built from travelling sine waves, one slow and one fast layer each, modulate the glow width and shift the hue. Using only sine keeps results consistent across GPUs and Skia's CPU path. Depth is mapped through a colour ramp measured from the reference. A requestAnimationFrame loop supplies time to the shader.
Good for
- Hero or feature cards that need an animated, edge-lit backdrop
- Resizable panels, chips and buttons that keep a consistent glow at any size
- Dark dashboards and landing sections with a calm moving surface
Dependencies
@shopify/react-native-skiareact-native