Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Centered Gradient Mesh Hero Block for React

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.

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 centered showcase hero over a soft gradient mesh, for React with Base UI, shown here for Loomwork, a moodboard canvas. Four large orbs, one in each corner of the section, blend into one continuous wash and drift so slowly you barely see them move. They're in the theme's foreground tones, so the mesh is a calm grey in light mode and a faint glow in dark, works with every theme, and fades out toward the foot so the next block joins cleanly. Over it sit an Announcement link, a headline, a subtitle, a Shine Button beside an outline Button, and below them a framed window of the product: a board of type, photo, palette, texture and note tiles with its layers list and inspector, with + marks on its top corners, masked where it runs on below the fold. On a phone the window is shorter and shows three tiles. Built with Mesh Gradient, Announcement, Status, Shine Button, Button and Guides, with Lucide icons and Tailwind CSS. Made for design tools, creative platforms and SaaS products that want an atmospheric, premium feel and a real look at the product.

FAQ

How do I change the mesh's colors?

Edit the MESH array, which goes to MeshGradient's colors prop: one color per corner, clockwise from the top start. It alternates var(--foreground) and var(--muted-foreground), so the mesh is monochrome and the primary color stays on the one button. For a colored wash use tokens such as var(--primary) and var(--chart-2). Use any CSS color or token as it is: the theme's colors are oklch values, so hsl(var(--primary)) would be an invalid color. Pass fewer than four and they repeat.

How do I make the mesh stronger or quieter?

The layer sets [--mesh-gradient-strength:0.2], a multiplier of the orbs' alpha, quiet enough that the announcement, the subtitle and the window keep their contrast in every theme. Raise it for a bolder wash and check the small muted text when you do. speed scales the drift, and grain={false} removes the fine, still grain that hides banding on dark screens. The layer's mask ([mask-image:linear-gradient(...)]) fades it out toward the section's foot.

Does the mesh move, and what happens with reduced motion?

Each orb drifts and breathes on a long, slow CSS animation that only changes translate and scale, so nothing repaints. With reduced motion the orbs rest where they start, and the announcement, headline, actions and window, which otherwise fade up once through Tailwind's starting: variant, render in place. The block has no state and runs no script.

How is the product window built, and how do I change it?

It's plain markup in BoardWindow: a toolbar, a layers list, a grid of tiles and an inspector, drawn in greyscale with the theme's tokens, so it follows light and dark mode. It's decorative and hidden from assistive technology, so keep real information in the copy. The tiles are a grid of spans: edit their classes to move or resize them. The window is taller than its box and masked, so it appears to run on below the fold; the box's height (h-64 on a phone, sm:h-[26rem]) decides how much shows.

Is the gradient mesh hero accessible?

Yes. The headline is the page's one h1, and the mesh and the window are decorative and hidden from assistive technology. The announcement and both calls to action are links named by their text. On Base UI, each button renders its link with render={<a href="#" />} and nativeButton={false}.

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

Use the mesh when you want an atmospheric, premium feel behind a showcase of the product. Use a plain or single radial gradient hero for a quieter, typography-first page, and a split hero when the copy needs a proof or a list beside it.

  • Pro

    A 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

    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

    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.

  • 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 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

    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.