shadcn.io is not affiliated with official shadcn/ui
Glass Card Hero Block for React
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.
Installation
Overview
A compact card-in-card hero with a frosted glass panel, for React with Base UI, shown here for Velo, an edge inference platform. Soft fields of your accent colour drift behind the panel, inside a hairline frame with + marks on its corners. The panel, a translucent card with a ring and a soft shadow, holds an announcement link, a headline, a sentence, three feature checks and two buttons: a Shine Button and an outline Button. The frame sits between the same side rails as the pricing blocks, under the page's top rule. It's built from Mesh Gradient, Guides, Announcement, Badge, Status, Shine Button and Button, with a backdrop-blur for the glass, CSS transitions for the entrance and your theme's tokens for every colour, so the card follows your theme, light or dark. For AI platforms, premium SaaS launches, developer tools and any hero that wants a modern glassy look without losing legibility.
FAQ
How do I change the colours behind the glass?
They're a Mesh Gradient, which is the frame's fill: GLOW gives it one colour per corner, clockwise from the top, here your theme's --primary and two mixes of it, so the glow follows your accent and no new hue joins the page. Pass any CSS colours, such as var(--chart-2). The block sets their strength with --mesh-gradient-strength (0.7 on a light page, 0.4 on a dark one); raise it for a bolder glow, but check the muted text stays readable over the brightest corner.
How is the glass made?
The inner panel is a translucent bg-card/70 with a border, a ring, a shadow and backdrop-blur-xl, so it blurs the mesh and its fine grain behind it, and both drift softly through it. Nothing has a dark scope, so the panel, the text, the pill and both buttons use your theme's own tokens with no overrides: a pale frosted pane on a light page, a smoked one on a dark page. On a low-powered device, drop the blur: the panel still separates by its tint, ring and border.
How do I point the buttons at my pages?
Start free and Read the docs are links (href="#"); point them at your sign-up page and your documentation.
Each button renders the link it's given with render, with nativeButton={false}.
Is the text readable over the moving colours?
Yes: every text keeps WCAG AA contrast, in light and dark pages and across theme presets, because it sits on the glass panel and not directly on the mesh. The mesh is hidden from assistive tech, the headline is the page's h1, the features are a list with their ticks hidden, and the pill and buttons are links with a visible focus ring. With reduced motion the colours hold still and nothing fades or rises on load.
How does it fit on a phone?
The space around the glass shrinks from m-8 to m-3 and its padding tightens, the headline steps down from text-5xl to text-4xl, and the feature lines wrap beside their ticks. The buttons wrap onto two lines when the row is too narrow, and both end on the first screen.
When should I use the glass card instead of a plain hero?
Use it when a sense of depth and colour suits the brand, as for AI and design products: the glow draws the eye and the glass keeps the text calm on top of it. When the product is the picture (code, a terminal, a dashboard), a hero such as Dark Code Window gives that picture the attention instead.
Related
- Pro
Centered Gradient Mesh Hero
BackdropsA 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
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
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
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
Install Command Hero
Code and terminalA compact centred hero for an open-source library with a star count pill, an install command to copy, a Shine Button, a GitHub star button and a ruled band of the repository's stats at the foot.