shadcn.io is not affiliated with official shadcn/ui
Centered Floating Feature Cards Hero Block for React
A centered hero between solid rails with four small product cards (uptime, a resolved incident, who is on call, latency) drifting in around the copy, a Shine Button, an outline button and a ruled proof band.
Installation
Overview
A centered hero with small product cards floating around the headline, for React with Base UI, shown here for Foxglove, an uptime and incident tool. The cards are greyscale pieces of the product itself, not labels: an uptime card with 24 daily bars, a resolved-incident card, who is on call now and next, and a p95 latency card with a sparkline. From the xl breakpoint they sit near the corners and drift in from them when the page loads; below it they sit in a grid under the action, and on a phone only the first two show. In the middle, an Announcement link, the headline, a subtitle, a Shine Button and an outline Button. A ruled band at the foot between the rails holds the proof: an Avatar group and a count. Built with Announcement, Status, Avatar, Shine Button, Button and Guides, with Lucide icons, Tailwind CSS and a CSS entrance that stays still under reduced motion. Made for monitoring, analytics and operations tools whose product can be sampled in four small widgets.
FAQ
How do I change the floating cards and where they sit?
Each card is a small component at the top of the file (UptimeCard, IncidentCard, OnCallCard, LatencyCard) and a list item in the ul. The list item places it from xl with logical offsets such as xl:start-10 xl:top-24, so a card on the start side moves to the right in right-to-left languages, and its starting: classes are the corner it drifts in from, mirrored with rtl:. Keep each card under 16rem wide: the copy column is 36rem and the cards sit in the margins beside it.
What happens to the cards on smaller screens?
Below xl the list stops floating its cards (xl:contents) and lays them out as a grid under the action: two columns from sm, one on a phone, and on a phone only the uptime and incident cards, so the first screen keeps the headline and the Shine Button. Everything reads at 320px with no horizontal scrolling.
Are the floating cards read by screen readers?
No. They're a decorative list marked aria-hidden, since the subtitle already says what the product does and the cards hold nothing to click. The headline is the page's one h1, the announcement and both calls to action are links named by their text, and the avatar row is hidden too, as the sentence beside it carries the count.
On Base UI, each button renders its link with render={<a href="#" />} and nativeButton={false}.
How do the cards fly in, and what happens with reduced motion?
It's CSS. Tailwind's starting: variant (@starting-style) sets where each card starts: transparent and about 20px out toward its own corner. A transition on opacity and translate brings it to rest when it first renders, staggered after the centered copy has faded up. With reduced motion, motion-reduce:transition-none removes the transitions and everything renders in place. The block has no state and runs no script, and the cards don't move after they arrive.
How is the proof band drawn, and how do I change it?
It's a band inside the column that draws its top rule with Guides (rules="top", marks="top", no sides) rather than a border, so the + marks land exactly on the crossing with the side rails. Edit the MEMBERS array for the avatars (an image src and the initials shown while it loads) and the sentence beside them. Only show photos of people who agreed to it, and keep the count true.
When should I use floating cards instead of a feature grid hero?
Use floating cards when the headline should stay the clear focus and the product can be sampled in a few small, believable widgets that show it at work. Use a feature grid or bento hero when each feature needs a sentence of its own and visitors should be able to scan and compare them.
Related
- Pro
Centered Feature Cards Grid Hero
Features and tablesA showcase hero between solid rails: an announcement link, a centred headline and a Shine Button, over three feature cells with overshooting hairlines, each led by a greyscale vignette of the feature.
- Pro
Centered Stacked Cards Deck Hero
Product windowsA centred showcase hero for a reporting workspace: the headline and a Shine Button, then a band between the rails with a fanned deck of three app windows (Dashboard, Analytics, Reports) that runs off its foot, masked.
- Pro
Bento Grid Feature Showcase Hero
Features and tablesA showcase hero with the headline on one side and the pitch on the other, over a bento of six labelled product views in cells that share hairlines.
- Pro
Split Layout Notification Stack Hero
Stats and live dataA reverse split hero for a notifications product: a panel flush to the start rail with a stack of notification cards, then a divider, the headline, three checks and a Shine Button.
- Pro
Split Layout Hover Cards Hero
Features and tablesA split hero for a deploy platform: an outline badge, the headline, one sentence and a Shine Button beside three linked feature cards that lift under the pointer, each in a cell with solid lines that run past its corners.
- Pro
Centered Minimal Hero
Type and motionA compact centered type-only hero: a two-line headline with a muted second line, one sentence, a Shine Button and a second action, on faded rails.