Hero reveal
A hero whose photo frame opens along the y-axis, then the headline blurs up and the action springs in.
Behaviour
- When the hero first scrolls into view, the photo frame opens from the middle along the y-axis (0.9s).
- The headline and the line under it fade up out of a blur, 0.12s apart.
- The action springs in last, at 1.28s.
- Plays once. BlurReveal is exported too, for any block.
- Reduced motion: the frame and text fade in, nothing moves or blurs, and the action skips the spring.
Props
| Prop | Type | Description |
|---|---|---|
| src | string | Background photo. It fills the frame with an 8px inset and rounded corners. |
| alt | stringdefault "" | Alt text. Empty marks the photo decorative. |
| title | ReactNode | The headline. |
| description | ReactNode | The line under the headline. |
| action | ReactNode | A button or link, popped in last. |
| className | string | Classes for the section: height, max width. |
Installation
npx shadcn@latest add https://purrfectui.com/r/hero-reveal.jsonHow to use
import { HeroReveal } from "@/components/ui/hero-reveal";
<HeroReveal
src="/hero.jpg"
title="Your wealth, finally working."
description="The AI finance app that tracks your spending."
action={<a href="#get">Get the app</a>}
/>Source code
Loading…
Credits
Ported from armour.vaibhavtomar.com.
License
MIT. Copy it into your project and change it as you like.
