shadcn.io is not affiliated with official shadcn/ui
Stat Hero CTA Block for React
A reverse split call to action with a giant hollow figure that floods with colour as it scrolls into view in the start cell, then a solid divider, a headline, one sentence, a Shine Button and a quiet second action.
Installation
Overview
A big-number call to action for React with Base UI. Between the page rails, the start cell holds one giant figure drawn as hollow letters, 50,000+ parcels labelled every day for Packwell, a made-up shipping-label tool; when it scrolls into view the letters flood with colour from the bottom. A solid divider with a + mark where it meets the top rule separates it from the headline, one sentence, a Shine Button and an outline button. On a phone the copy comes first and the figure follows under a rule. It's built from Outline Text, Guides, Shine Button and Button, with CSS transitions for the entrance. For milestones, customer counts and any closing section where one number should be the loudest thing on the page.
FAQ
How do I change the figure?
Edit FIGURE at the top of the file and the caption under it. The figure and its caption are one figure, so a screen reader hears them together. The outline is the real text, and the colour that floods it is a copy of it hidden from screen readers, so nothing is read twice.
When does the figure fill with colour?
When at least half of it has scrolled into view, once. Until then it's an outline in your text colour, which already reads at that size; the fill is only the finish. Without scripts the fill is shown from the start, and with reduced motion the figure fills at once instead of flooding.
Can I change the outline and the fill colours?
Yes. Outline Text takes strokeColor, fillColor, strokeWidth, duration and fillFrom (bottom, top, start, end or the centre). The block keeps both to your text colour so any preset keeps its contrast, and the primary colour stays on the button.
Where do the buttons go?
Both are links (href="#"): point Start shipping free at your sign-up and Read the case studies at your stories.
Each button renders the link it's given with render, with nativeButton={false}.
How does the split work?
The two cells share a two-column grid from lg; the copy is first in the document, so it is read first, and the figure is placed in the start column. The divider is the copy cell's own border, with marks drawn by Guides where it meets the top rule. Below lg the cells stack and a Guides rule separates them.
Related
- Pro
Centered Number With Stats CTA
Figures and statsA card in card call to action that follows your theme: one anchor figure at display size with a Shine Button, beside three supporting stats set like a receipt with dotted leaders.
- Pro
Stat Strip CTA
Figures and statsA band call to action with the headline and a Shine Button in a header band, then a closing band of three figures that are tabs, divided by solid hairlines: pick a figure to read how it is measured.
- Pro
Centered Metric Cluster CTA
Figures and statsA centred launch-day call to action with a scoreboard drawn as a framed figure: an Upvote button whose count rolls on press, flanked by the comment count and today's rank, and a Shine Button.
- Pro
Animated Counter Hero
Stats and live dataA compact centered hero for an invoicing app with an announcement pill, a Shine Button and a second action, over a hairline band of four figures that count up when they scroll into view.
- Pro
Counter Stats Hero
Stats and live dataA compact, start-aligned hero for an email API on solid rails: a headline, a Shine Button and an outline button, then four counters in separate cells whose hairlines overshoot their corners.
- Pro
Card Inset Big Metric Checklist CTA
Figures and statsA card-in-card startup-program CTA split in two: one giant credit figure circled by a hand-drawn pen stroke in a hairline frame at the start, and the headline, a three-line checklist, a Shine Button and an eligibility note at the end.