Card and glass panel
BetaLayoutOpen in the workshop
The container: solid cards for data, frosted glass for chrome and hero surfaces.
.xg-card (+ .xg-glass) · --flush · --interactive · __header __title __footerExample and markup
Live, from xg-ui.css and xg-ui.js. Switch the brand and mode on the example itself, or for the whole site in the header.
Solid card
Data, forms, tables.
Glass panel
Chrome and hero surfaces.
Interactive card
The whole card is the link.
Markup
<div style="display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:16px;padding:24px;border-radius:var(--xg-radius-panel);background:radial-gradient(60% 80% at 80% 0%,var(--xg-color-primary-soft),transparent),var(--xg-color-bg-page)">
<div class="xg-card">
<h3 class="xg-card__title">Solid card</h3>
<p class="xg-text-muted" style="margin:6px 0 0">Data, forms, tables.</p>
</div>
<div class="xg-card xg-glass">
<h3 class="xg-card__title">Glass panel</h3>
<p class="xg-text-muted" style="margin:6px 0 0">Chrome and hero surfaces.</p>
</div>
<a class="xg-card xg-card--interactive" href="#" style="text-decoration:none">
<h3 class="xg-card__title">Interactive card</h3>
<p class="xg-text-muted" style="margin:6px 0 0">The whole card is the link.</p>
</a>
</div>States
Hover, focus and pressed are forced here with .is-hover, .is-focus and .is-active so they can be seen side by side; in a product they come from :hover, :focus-visible and :active.
| State | Card |
|---|---|
| Solid | RevenueLast 30 days |
| Glass | RevenueLast 30 days |
| Interactive, hover | RevenueLast 30 days |
When to use it
Use it for
grouping one subject: a chart, a form, a list.
Not for
cards inside cards; glass behind dense tables (use solid).
Rules
- Solid card for anything with numbers or forms; glass for navigation, toasts, and panels over the page gradient.
- Glass is white at 58–78% with 18 px blur and saturate 160%, a 1 px light edge and a soft shadow. Where blur is not supported or reduced transparency is requested, the solid fallback is used.
- Padding 20 px; 16 px gap between cards.
Accessibility
- Glass text pairs are measured over the page color (see Accessibility). Interactive cards are links or buttons, not divs with click handlers.
Every color pair this component uses is measured for both brands in light and dark on the Accessibility page.
Related
Also in Layout: App shell. Used in the patterns Onboarding and sign-up, Loading, empty and error states.
Status Beta: usable; class names may still change in a minor release, with a note (see Releasing).