Card
On this page
Overview
Use cards to group small previews of content with optional calls to action.
Cards should contain a header with a heading level tag (h1-h6) and must not
replace primary page content. Cards do not manage focus; interactive elements
inside (links, CTAs) must be keyboard-accessible via Tab and activated with
Enter. Screen readers announce card content in DOM order. The promo variant
should be used for promotional content separate from the main page flow.
Edit element properties
rh-card {
& h2 {
font-size: initial;
}
}
import '@rhds/elements/rh-cta/rh-cta.js';
import '@rhds/elements/rh-card/rh-card.js';
<rh-card>
<h2 slot="header">Card</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Nullam eleifend elit sed est egestas, a sollicitudin mauris
tincidunt. Pellentesque vel dapibus risus. Nullam aliquam
felis orci, eget cursus mi lacinia quis. Vivamus at felis sem.</p>
<rh-cta slot="footer" variant="primary" href="#">Call to action</rh-cta>
</rh-card>
import { Card } from "@rhds/elements/react/rh-card/rh-card.js";
import { Cta } from "@rhds/elements/react/rh-cta/rh-cta.js";
// NOTE: React 19+ does not require these wrapper imports.
// You can use the custom elements directly as-is.
export const Demo = () => (
<Card>
<h2 slot="header">Card</h2>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.
Nullam eleifend elit sed est egestas, a sollicitudin mauris
tincidunt. Pellentesque vel dapibus risus. Nullam aliquam
felis orci, eget cursus mi lacinia quis. Vivamus at felis sem.</p>
<Cta slot="footer" variant="primary" href="#">Call to action</Cta>
</Card>
);
Sets color palette, which affects the element's styles as well as descendants' color theme.
Overrides parent color context. Accepts 'lightest' | 'lighter' | 'light' | 'dark' |
'darker' | 'darkest'. Promo variants automatically compute palette: featured promos
use the -est suffix, standard promos use the -er suffix. Defaults to undefined
(inherits from parent context). See CSS Custom Properties
for default values.
Controls the card's visual variant. Accepts 'promo' or undefined. When set to 'promo', the card renders in a promotional layout with grid-based positioning for image, body, and footer. Defaults to undefined (standard card layout). Avoid mixing promo and standard cards in the same group.
When true, a promo card bleeds to the edges of its container with no border.
Only applies when variant is 'promo'. Requires the image slot to be populated
for the full-width grid layout. Defaults to false. Boolean attribute.
Status
- Figma library:
-
Ready - RH Elements:
-
Ready - RH Shared Libs:
-
Ready
When to use
- When you need to group content in a container
- When you need to combine small previews of information along with one or more calls to action
Status checklist
| Property | Status | Meaning |
|---|---|---|
| Figma library |
|
Component is available in the Figma library |
| RH Elements |
|
Component is available in RH Elements |
| RH Shared Libs |
|
Component is available in RH Shared Libs |
Other libraries
To learn more about our other libraries, visit this page.
Feedback
To give feedback about anything on this page, contact us.