Skip to main content

Appearances and variants

The card is a div with a rounded corner and a background. Subtle, outline, solid, elevated, flat, and unstyled are the appearances. Subtle, outline, solid, elevated, and flat each come in six variants (primary, dominant, success, info, warning, and danger). A card without appearance is flat, so add class p-5 for padding. Unstyled has no surface and ignores the variant.

Subtle

Primary

A card with a tinted background, for notes or a second level of content. It marks the main action of a view.

Dominant

A card with a tinted background, for notes or a second level of content. It is neutral content.

Success

A card with a tinted background, for notes or a second level of content. It confirms a completed action.

Info

A card with a tinted background, for notes or a second level of content. It shows a neutral notice.

Warning

A card with a tinted background, for notes or a second level of content. It asks for attention before continuing.

Danger

A card with a tinted background, for notes or a second level of content. It warns about an error or a destructive action.

Outline

Primary

A card with only a coloured border and no shadow. It marks the main action of a view.

Dominant

A card with only a coloured border and no shadow. It is neutral content.

Success

A card with only a coloured border and no shadow. It confirms a completed action.

Info

A card with only a coloured border and no shadow. It shows a neutral notice.

Warning

A card with only a coloured border and no shadow. It asks for attention before continuing.

Danger

A card with only a coloured border and no shadow. It warns about an error or a destructive action.

Solid

Primary

A card with a strong fill, for emphasis. It marks the main action of a view.

Dominant

A card with a strong fill, for emphasis. It is neutral content.

Success

A card with a strong fill, for emphasis. It confirms a completed action.

Info

A card with a strong fill, for emphasis. It shows a neutral notice.

Warning

A card with a strong fill, for emphasis. It asks for attention before continuing.

Danger

A card with a strong fill, for emphasis. It warns about an error or a destructive action.

Elevated

Primary

A card with a shadow and a coloured top edge. It marks the main action of a view.

Dominant

A card with a shadow and a coloured top edge. It is neutral content.

Success

A card with a shadow and a coloured top edge. It confirms a completed action.

Info

A card with a shadow and a coloured top edge. It shows a neutral notice.

Warning

A card with a shadow and a coloured top edge. It asks for attention before continuing.

Danger

A card with a shadow and a coloured top edge. It warns about an error or a destructive action.

Flat

Primary

The default surface without padding, for sections and media that bring their own padding. It marks the main action of a view.

Dominant

The default surface without padding, for sections and media that bring their own padding. It is neutral content.

Success

The default surface without padding, for sections and media that bring their own padding. It confirms a completed action.

Info

The default surface without padding, for sections and media that bring their own padding. It shows a neutral notice.

Warning

The default surface without padding, for sections and media that bring their own padding. It asks for attention before continuing.

Danger

The default surface without padding, for sections and media that bring their own padding. It warns about an error or a destructive action.

Unstyled

Unstyled

No surface and no padding. The caller adds its own background, border, and padding.

Collapsible

An expandable card renders native <details> and <summary> without JavaScript. Subtle, outline, solid, elevated, and flat each come in six variants. An expandable card takes no padding, so do not add class="p-5": the summary and the body set their own. expandable="open" starts the card open and expandable="closed" starts it closed. title renders a text summary with a chevron; slot="header" replaces its contents, as in these examples. Use summary-class to replace the summary classes. Subtle and solid colour the summary, and the body stays neutral. Subtle and solid frames take a border in the variant colour, and the summary rounds its own corners, so nothing inside the card is clipped. On other variants the title and chevron inherit the card colour. Turn a chevron with [[open]>summary>&]:rotate-180: it reacts only to its own card, also when cards are nested.

Title prop

Shipping details

The title prop renders the heading and the chevron; use the header slot only for a custom summary.

Subtle

Primary

A card with a tinted background, for notes or a second level of content. It marks the main action of a view.

Dominant

A card with a tinted background, for notes or a second level of content. It is neutral content.

Success

A card with a tinted background, for notes or a second level of content. It confirms a completed action.

Info

A card with a tinted background, for notes or a second level of content. It shows a neutral notice.

Warning

A card with a tinted background, for notes or a second level of content. It asks for attention before continuing.

Danger

A card with a tinted background, for notes or a second level of content. It warns about an error or a destructive action.

Outline

Primary

A card with only a coloured border and no shadow. It marks the main action of a view.

Dominant

A card with only a coloured border and no shadow. It is neutral content.

Success

A card with only a coloured border and no shadow. It confirms a completed action.

Info

A card with only a coloured border and no shadow. It shows a neutral notice.

Warning

A card with only a coloured border and no shadow. It asks for attention before continuing.

Danger

A card with only a coloured border and no shadow. It warns about an error or a destructive action.

Solid

Primary

A card with a strong fill, for emphasis. It marks the main action of a view.

Dominant

A card with a strong fill, for emphasis. It is neutral content.

Success

A card with a strong fill, for emphasis. It confirms a completed action.

Info

A card with a strong fill, for emphasis. It shows a neutral notice.

Warning

A card with a strong fill, for emphasis. It asks for attention before continuing.

Danger

A card with a strong fill, for emphasis. It warns about an error or a destructive action.

Elevated

Primary

A card with a shadow and a coloured top edge. It marks the main action of a view.

Dominant

A card with a shadow and a coloured top edge. It is neutral content.

Success

A card with a shadow and a coloured top edge. It confirms a completed action.

Info

A card with a shadow and a coloured top edge. It shows a neutral notice.

Warning

A card with a shadow and a coloured top edge. It asks for attention before continuing.

Danger

A card with a shadow and a coloured top edge. It warns about an error or a destructive action.

Flat

Primary

The standard surface with a thin coloured border and a small shadow. It marks the main action of a view.

Dominant

The standard surface with a thin coloured border and a small shadow. It is neutral content.

Success

The standard surface with a thin coloured border and a small shadow. It confirms a completed action.

Info

The standard surface with a thin coloured border and a small shadow. It shows a neutral notice.

Warning

The standard surface with a thin coloured border and a small shadow. It asks for attention before continuing.

Danger

The standard surface with a thin coloured border and a small shadow. It warns about an error or a destructive action.

Header, body and footer

A card takes a header and a footer through slot="header" and slot="footer"; title alone renders a header with the title; the body is the default slot and sets its own padding. The header carries the variant: subtle and solid fill it, while the body and the footer stay neutral. The separators between the sections follow the variant, like the expandable separator. Without a header the card keeps its usual surface.

Title prop

Billing address

The title prop renders the header with an h2; the header slot replaces it.

Subtle

Primary

The header has a tinted background; the body stays neutral. It marks the main action of a view.

Dominant

The header has a tinted background; the body stays neutral. It is neutral content.

Success

The header has a tinted background; the body stays neutral. It confirms a completed action.

Info

The header has a tinted background; the body stays neutral. It shows a neutral notice.

Warning

The header has a tinted background; the body stays neutral. It asks for attention before continuing.

Danger

The header has a tinted background; the body stays neutral. It warns about an error or a destructive action.

Outline

Primary

A coloured border around the header, the body, and the footer. It marks the main action of a view.

Dominant

A coloured border around the header, the body, and the footer. It is neutral content.

Success

A coloured border around the header, the body, and the footer. It confirms a completed action.

Info

A coloured border around the header, the body, and the footer. It shows a neutral notice.

Warning

A coloured border around the header, the body, and the footer. It asks for attention before continuing.

Danger

A coloured border around the header, the body, and the footer. It warns about an error or a destructive action.

Solid

Primary

The header has a strong fill; the body stays neutral. It marks the main action of a view.

Dominant

The header has a strong fill; the body stays neutral. It is neutral content.

Success

The header has a strong fill; the body stays neutral. It confirms a completed action.

Info

The header has a strong fill; the body stays neutral. It shows a neutral notice.

Warning

The header has a strong fill; the body stays neutral. It asks for attention before continuing.

Danger

The header has a strong fill; the body stays neutral. It warns about an error or a destructive action.

Elevated

Primary

A shadow and a coloured top edge around the sections. It marks the main action of a view.

Dominant

A shadow and a coloured top edge around the sections. It is neutral content.

Success

A shadow and a coloured top edge around the sections. It confirms a completed action.

Info

A shadow and a coloured top edge around the sections. It shows a neutral notice.

Warning

A shadow and a coloured top edge around the sections. It asks for attention before continuing.

Danger

A shadow and a coloured top edge around the sections. It warns about an error or a destructive action.

Flat

Primary

The standard surface with a thin coloured border. It marks the main action of a view.

Dominant

The standard surface with a thin coloured border. It is neutral content.

Success

The standard surface with a thin coloured border. It confirms a completed action.

Info

The standard surface with a thin coloured border. It shows a neutral notice.

Warning

The standard surface with a thin coloured border. It asks for attention before continuing.

Danger

The standard surface with a thin coloured border. It warns about an error or a destructive action.

With image

An image at the top, or at the side from the sm breakpoint up. The image area here is a decorative block; use an img with alt in your page, or alt="" when the title already says it. overflow-hidden keeps the image inside the rounded corners.

Guide

Plan the next release

How to group the work, set a date and tell the team.

Read more

Weekly summary

What the team finished, and what is still open, in one page.

Open summary

Stat

A number with a label and a change. The arrow is not enough to tell up from down, so the text also has a plus or minus sign.

Total orders

1,284

+12.5%

Compared with last month

Refunds

42

−3.1%

Compared with last month

Profile

An avatar, a name, a role and two actions. The two buttons share the width with flex-1.

AM

Alex Morgan

Product designer

Semantic elements

Cards render a div by default. Set as="section" for a named section or as="main" for the page's main content. Do not nest a main element inside another main. Use appearance="unstyled" with your own surface classes when the standard appearances do not fit.

Project details

A named section rendered as a card.