shadcn.io is not affiliated with official shadcn/ui
Starfield Backdrop Hero Block for React
A compact centred hero flying slowly through a field of stars on a framed stage: a live launch pill, a headline, a Shine Button to the waitlist, a quiet second link and the waitlist's size.
Installation
Overview
A compact centred hero with a starfield behind it, for React with Base UI. Between the page rails a framed stage, hairlines with + marks on its corners, flies slowly through a field of stars: each one appears small and dim near the centre and streaks as it passes the edge, while distant stars hold still behind them and the field fades out toward the stage's edges. Over it sit an announcement pill with a pulsing Launching soon status, a headline, one supporting line, a Shine Button to the waitlist, a quiet ghost link, and a row of avatars with the number of teams on the list. It's built from Starfield, Announcement, Status Pulse Text, Avatar, Shine Button, Button and Guides, with CSS for the stars and the entrance and your theme's tokens for every colour: the stars are drawn in the foreground colour, so they're light specks on a dark theme and dark specks on a light one. For launch announcements, deployment and infrastructure products, space-tech products and any page that wants a calm, cosmic first screen.
FAQ
How do I change how many stars there are and how fast they fly?
Set them on Starfield. count is how many stars fly at once in a large box (120 here, up to 300); a smaller box, such as this stage on a phone, flies a share of them, so the field looks as dense at every size. speed is a multiplier: 0.5 is the slow drift here, 1 a calm cruise and 3 warp speed. fade sets where the stars fade out (radial, top, bottom or none), and starColor takes any CSS colour, your theme's foreground by default.
Why do the stars move, and can I stop them?
A starfield that flies reads as speed, which is what the headline promises, and it does it with CSS alone: every star is a small element placed when the page renders and moved by keyframes, with no canvas and no script running in the browser. With reduced motion turned on in the system the stars stop where they are and the stage shows a still star map. To slow them further, lower speed; for a stage without stars, swap Starfield for a div with the same classes and the content stays as it is.
Does the starfield work on a light page?
Yes. The block follows the page theme and never forces dark: the stage has no fill of its own, the stars take text-foreground (they fade in as soft dark specks on a light page and as bright ones on a dark page), and the subtitle, pill and buttons use their stock styles. The hairline frame sets the stage off in both themes. For a different star colour, pass starColor.
Is the starfield hero accessible for screen readers?
Yes. The stars are a decoration: their layer is hidden from screen readers and never takes a click. The headline is the page's one h1, the pill is a single link that reads Launching soon, Join the waitlist (its pulsing dot is hidden, and the words carry the status), and both calls to action are links named by their text. The avatars are decoration, and the line beside them says the number in words. Every text meets WCAG AA contrast on the stage, in light and dark, and with reduced motion nothing fades in, rises or pulses.
How does it fit on a phone?
The headline steps down from text-5xl to text-4xl and balances its lines, so the second line breaks evenly instead of leaving one word alone. The calls to action sit side by side when they fit and wrap onto two lines when they don't, centred either way, and the Shine Button is inside the first screen. The stars are spread round the stage's edges in proportion, so the field covers a narrow stage as evenly as a wide one.
How do I turn the pill into my launch date or waitlist count?
Change the two parts of the announcement: the status (text on StatusPulseText, here Launching soon, with variant for its colour) and the muted text after the dot. Point its href at your waitlist, and edit the number beside the avatars with it. For a date, write it as text the server and the browser agree on, such as "Opens in June", or a relative label you update, so the pill never shows a launch that has already passed.
Related
- Pro
Concentric Rings Hero
BackdropsA compact, centred hero for a design tool on solid rails: concentric rings breathe behind a headline, a Shine Button and an outline button, over a ruled band of three stats.
- Pro
Perspective Grid Hero
BackdropsA showcase hero for a browser racing engine: one panel between solid page rails where a perspective floor grid rolls toward you under a beta pill, a headline, a Shine Button and an outline button.
- Pro
Glass Card Hero
BackdropsA compact card-in-card hero on solid rails: a frosted glass panel with a ring over a drifting mesh of your accent's tones, in a hairline frame with + marks, with a Shine Button and an outline button.
- Pro
Code Window Hero
Code and terminalA split hero for an API client generator on solid rails: a headline and a Shine Button beside a code window whose snippet comes in token by token, in a hairline frame with + marks.
- Pro
Centered Gradient Orbs Hero
BackdropsA split hero between solid rails: a headline with a Shine Button and an outline button on one side, and on the other a framed panel where soft orbs of the theme's foreground drift slowly behind three stats.
- Pro
Single-CTA Ultra-Minimal Statement Hero
Type and motionAn ultra-minimal statement hero: a two-word headline at display size in one cell, and in a cell across a solid divider the one Shine Button and two lines of reassurance.