Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Centered Gradient Text Hero Block for React

A start-aligned statement hero whose headline ends on two words that fade from the text color toward the page, with a Shine Button, an outline button and a ruled band of three proof cells.

Framework
UI library

Preview

Preview width

Installation

Part of Pro
Pro unlocks the code and one-line install of every Pro button and text effect, plus the MCP for your AI editor.
Have Pro already? Sign in to open it.Opens here as soon as you're Pro.

Overview

A start-aligned statement hero with a gradient on the headline's last words, for React with Base UI, shown here for Marginalia, a writing app. "First draft" fades from the full text color to a softer tone of it, so the phrase seems to dissolve and the headline becomes the visual centerpiece without any image, over a faint monochrome glow. Around it sit an Announcement link, one supporting sentence, a Shine Button and an outline Button. A full-width band between the page's solid rails, ruled with + marks on its corners, holds three proof cells that share hairlines: an Avatar group with a count, a figure and an offer. The gradient comes from Gradient Text, held still, and is made from the theme's own tokens, so it follows every theme and dark mode. Built with Gradient Text, 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 writing, design and creative tools whose headline should carry the page.

FAQ

How do I change the gradient's colors?

Edit the FADE array, which goes to GradientText's colors prop, start to end. It runs from var(--foreground) to color-mix(in oklab, var(--foreground) 60%, var(--background)), the text color mixed into the page, so it fades the same way in light and dark mode. For a colored accent, use tokens such as var(--primary) and var(--chart-2). Keep the faded end at 60% or more: the words are large text, which needs at least 3:1 contrast, and at 50% the end drops below it in light themes.

Can the gradient flow through the words?

Yes: remove animate={false}, and the gradient slides through the letters on a seamless loop (duration sets one pass, 3000ms by default). It's held still here so the headline reads calmly; a moving phrase draws the eye every second the page is open. With reduced motion the gradient holds still either way.

How do I put the gradient on a different word or phrase?

Move the GradientText to the words you want to stress and pass them as text. It renders an inline block, so the phrase stays on one line: keep it to a word or two, or a long phrase can't wrap on a phone. Keep the {" "} before it so a space separates it from the words before.

Is the gradient text accessible?

Yes. The gradient is a background clipped to the letters, so the phrase is real text in the h1, and screen readers read "Finally finish the first draft" as one heading. In forced-colors (high contrast) mode the gradient is dropped and the phrase takes the system's text color. The announcement and both calls to action are links named by their text, and the avatars are hidden from screen readers, since the count beside them carries the claim. The band is a description list, so each figure is read with its label. On Base UI, each button renders its link with render={<a href="#" />} and nativeButton={false}.

How do I edit the proof band?

Each cell is a term and a value in a description list, set with divide-x on sm and up and divide-y on a phone, so the dividers follow right-to-left layouts. Edit the figures and labels in place, keep each value in its bdi, and edit the MEMBERS array for the avatars (an image src and the initials shown while it loads). Only show photos of people who agreed to it, and keep the count true. The band draws its rule with Guides rather than a border, so the marks land on the side rails.

When should I use a gradient text hero instead of a plain one?

Use it when the headline is the page's strongest asset and one phrase carries the promise, such as "first draft", "faster" or "together". The fade gives it weight without an image. Use a plain headline for a strictly minimal brand, and a showcase hero when the product itself should be the first thing visitors see.

  • Pro

    A compact centered hero whose second headline line glints as a light runs through it, with a launch pill, the Shine Button and four stats in cells below.

  • Pro

    A centered hero between solid rails whose offer sits in a card with a slowly turning sweep of the theme's foreground color around its border, with a Shine Button, an outline button and a row of three stats.

  • Pro

    A centered showcase hero over a quiet monochrome mesh that drifts slowly behind the section, with a Shine Button, an outline button and a framed window of a moodboard canvas that runs on below the fold.

  • Pro

    A compact centered hero under a soft monochrome glow, with the side rails fading in from the top, an announcement link, a Shine Button, an avatar row and a band of three figures.

  • Pro

    Avatar Stack Side Rail Hero

    Logos and social proof

    A compact hero for a community: a headline, a Shine Button and a second action beside a side rail of proof: a stack of member avatars over a line of social proof, then three stats in ruled rows.

  • Pro

    Centered Minimal Hero

    Type and motion

    A 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.