A card is an area of emphasis, to be displayed in a list or on its own, containing content and actions about a single subject.
Warning
This is currently experimental because more research is needed to validate it.
Card
Card heading
Card body
Status Card
Card heading Status:Registered
Optional header copy
Card body
Contents
<div class="rosgovuk-card-wrapper">
<div class="rosgovuk-card">
<h2>Card Heading
<span className="govuk-visually-hidden">Status:</span>
<strong class="govuk-tag">Registered</strong>
</h2>
<p>Optional header copy</p>
<button class="govuk-button">Primary</button>
<button class="govuk-button govuk-button--secondary">Secondary</button>
</div>
</div>
<Card>
<Heading.H2>
Heading <span className="govuk-visually-hidden">Status:</span>
<Tag color={TagColors.GREEN}>REGISTERED</Tag>
</Heading.H2>
<Paragraph>Optional Body copy</Paragraph>
<Button className="govuk-!-margin-right-2">Primary</Button>
<Button.Secondary>Secondary</Button.Secondary>
</Card>
</div>
When to use this component
Cards are surfaces that display content and actions on a single topic. Use this to provide highlighted structured content, such as a summary, a call-to-action or an emphasized button.
Card layouts can vary to support the types of content they contain. The following elements are commonly found among that variety:
- Heading
- Paragraph
- Primary and optional Secondary button
Card widths should be constrained by their parent container.
Developers must ensure that the padding of the card is uniform at all screen widths, and that the last element in the card has no bottom margins.
When not to use this component
A card should not contain too much information. Please consider the following rules:
- They should be easy to scan for relevant and actionable information. Elements, like text and images, should be placed on them in a way that clearly indicates hierarchy
- Headings should be one line only
- There should only be one paragraph of (optional) text, which should also be short
- Do not use links within the card as this breaks colour contrast rules
Research on this component
Services using this pattern
- Unknown
