On this page
@addTagHelper *, Webority.Ui.RazorA basic card
A card is a padded surface around whatever you put inside it, so one section of a page reads as one unit.
Everything inside sits on one raised surface with consistent padding.
Header & actions
Name a card with a title and an icon, and put the controls that act on it on the same row.
8 people have access to this project.
Press Ctrl K to jump to any page.
Two-factor authentication is enabled for all admins.
Long title with a button
A long title wraps beside the actions; the button keeps its width and its label stays on one line.
Two registrations are linked.
Brand title face
A product sets the title face with --wui-card-title-font-family and the weight with --wui-card-title-fw on the card.
The title reads in the product's display face.
Variants
Flat is the default; elevated and outline stand off the page, filled recedes, and accent flags a status with a coloured stripe.
Flat surface, no border.
A firmer 1px edge.
A heavier 2px border.
Recessed fill, all over.
Primary stripe.
All checks pass.
Renews in 3 days.
Action required.
Padding & width
Tune the inner spacing with padding, and cap a standalone card's width so it does not stretch across a wide page.
Denser, good for tiles and widgets.
Roomier, good for a focal card.
A standalone card capped at a comfortable reading width instead of stretching across the page.
Media
A media band runs across the top of the card, the image-card pattern for previews and thumbnails.
Get your team set up in a few steps.
Clickable card
Give the card an href and the whole surface becomes one link, so it needs no nested links or buttons.
Edge-to-edge content
Drop the body padding for a table or list that should touch the card's sides, and clip it to the rounded corners.
| Building | Status |
|---|---|
| Corporate Office | Draft |
| Server Room | Compliant |
| Building | Status |
|---|---|
| Corporate Office | Draft |
| Server Room | Compliant |
Every option
Every value of every prop, one cell each.
children: the card content
children (required)
Rendered inside the body.
variant: all five
variant="flat" (default)
Card content.
variant="elevated"
Card content.
variant="outline"
Card content.
variant="filled"
Card content.
variant="accent"
Card content.
tone: accent variant, every tone
variant="accent" tone="primary" (default)
Stripe colour.
variant="accent" tone="success"
Stripe colour.
variant="accent" tone="warning"
Stripe colour.
variant="accent" tone="danger"
Stripe colour.
variant="accent" tone="info"
Stripe colour.
padding: every value
padding="none"
Body inset at none.
padding="sm"
Body inset at sm.
padding="md" (default)
Body inset at md.
padding="lg"
Body inset at lg.
maxWidth: every preset, a number and a string
max-width="xs"
Capped and centred.
max-width="sm"
Capped and centred.
max-width="md"
Capped and centred.
max-width="lg"
Capped and centred.
max-width-px="480"
max-width-px takes a whole number of pixels.
max-width-px="640"
A width in pixels: 40rem is 640px at 16px per rem.
title, subtitle and headerIcon: the header title area
title only
No subtitle, no icon.
subtitle only (no title)
A header still opens for a bare subtitle.
header-icon only (no title or subtitle)
An icon alone still opens a header.
header-icon + title + subtitle
The full title area.
titleFont: every value
title-font="sans" (default)
The interface face.
title-font="serif"
Drawn in the display typeface.
titleClassName: a class on the title
titleClassName (React only; Razor has no title class hook)
Razor styles the title through the card's own attributes.
headerActions: the right-aligned header controls
<app-card-actions> only
Actions right-align even without a title.
title + <app-card-actions> together
Both share one header row.
headerExtra: content after the title
headerExtra (React only; Razor has no slot beside the title)
Razor puts any badge inside the body instead.
header: fully custom
header (React only; Razor composes the header inside app-card)
Title and actions are the Razor way to build the header.
footer & media
<app-card-footer> only
A row below the body.
<app-card-media> only
Media sits above the header.
media + header + footer together
All three bands stack in order.
href and onClick: clickable, or neither
(no href): plain div, not clickable
No role, no hover.
href="#acme": the whole card is a link
onClick (React only; Razor has no client click, use href)
linkComponent: the router link for a clickable card
linkComponent (React only; Razor href renders the link directly)
onClose, dismissible and closeLabel: the close button
onClose (React only; Razor raises wui-card:close on the card)
Pressing the close button removes the card.
dismissible="true": shows the close button; pressing it hides the card
A close button with no handler.
close-label: the close button's accessible name (no visible text)
Screen readers announce the button as Close tip.
body: padded or flush
body (default): padded
Standard card body inset.
body="false": content meets the edges
| Row | Value |
className: classes on the outer box
class="border-primary" (React: className)
The class lands on the card's outer box.
bodyClassName: classes on the body
bodyClassName (React only; Razor puts the class on the content)
The class sits on this paragraph.
headerClassName: classes on the header
headerClassName (React only; Razor has no header class hook)
The header keeps the default style.
lifted: hover lift
lifted (default): no hover lift
Hover: no movement.
lifted="true": 1px hover translate
Hover to see the lift.
flush and divided
flush="true": table meets the edges
| Row | Value |
divided="true": a rule under the header
A rule sits under the header.
flush="true" divided="true"
| Row | Value |
(default): neither
Padded body, no rule.
overflow: long content in a capped-width card
max-width="xs" with a long unbroken title and long body text
Long-form body copy inside a narrow, capped card confirms the text wraps instead of overflowing the fixed width, and that the header titles wrap alongside it.
Guidance
What to do, and what to avoid.
Use it when
- A page section needs to be visually grouped and set apart from the rest.
- You are laying out a dashboard of summaries, each on its own surface.
- A form or list should read as one self-contained block.
Reach for something else when
- You need a masthead with a page title and actions. → AppPageHeader
- The content is a transient message, not a lasting section. → AppAlert
- You are showing an empty section with a call to action. → AppEmptyState
- Everything on the page is already one surface: nesting adds noise. → plain layout
One titled subject per card
Your plan renews on 12 Aug 2026.
One titled card, one coherent subject: the header tells the user what this block is.
Your plan renews on 12 Aug 2026.
3 new members joined this week.
Server Room assessment is overdue.
Three unrelated facts crammed into one untitled card, so none of them stands out.
Use body={false} for a table
| Corporate Office | Draft |
A table uses body={false} so its rows sit flush to the card edges.
| Corporate Office | Draft |
The default body padding leaves an awkward inset gap around a full-width table.
Reference
Try every prop, read the full list, and check keyboard and screen reader behaviour.
20 props. The 2 most used come first.
Used on most screens 2 props
| Prop | Type | Default | Description |
|---|---|---|---|
| titledefault - | string | - | Card heading; renders the header strip. |
| subtitledefault - | string | - | A muted line under the title. |
Less common 18 props
| Prop | Type | Default | Description |
|---|---|---|---|
| (content)default - | markup | - | The card content. Rendered inside the body unless body is false. |
| lifteddefault false | bool | false | 1px hover translate (.card-lifted), not a drop shadow. |
| flushdefault false | bool | false | Clips the content to the card's rounded corners and removes the body padding, for a table or image that runs edge to edge. The header and footer keep their padding. Anything that pokes outside the card, such as an inline menu, is clipped. |
| divideddefault false | bool | false | Draws a thin rule under the header. Needs a header (title, subtitle, headerIcon, headerActions or header). The rule colour is the --wui-card-divider-color token. |
| variantdefault flat | Flat | Elevated | Outline | Filled | Accent | flat | The visual treatment of the card. |
| tonedefault primary | Primary | Success | Warning | Danger | Info | primary | Colours the accent stripe. |
| paddingdefault md | None | Sm | Md | Lg | md | Header, body and footer padding preset. The default (md) is a uniform 20px; none clears only the body, for a table or list that runs edge to edge, and keeps the header and footer inset. For an arbitrary inset, add a class (see className) that sets the --wui-card-pad token instead of using this preset scale. |
| max-widthdefault - | xs | sm | md | lg | - | Cap and centre a standalone card. A preset: xs, sm, md or lg. |
| max-width-pxdefault - | number | - | The max width in pixels, instead of a preset. |
| title-fontdefault sans | Sans | Serif | sans | Face of the title. serif draws it in the display typeface. |
| header-icondefault - | string | - | Leading header glyph: an icon name (or a node). |
| hrefdefault - | string | - | Makes the whole card a link. |
| dismissibledefault false | bool | false | Show a close button at the end of the header (defaults to true when onClose is set). |
| close-labeldefault Close | string | Close | Accessible name of the close button. |
| bodydefault true | bool | true | Wrap children in .card-body. False when the content brings its own padding. |
| <app-card-actions>default - | markup | - | Child slot rendering its content right-aligned in the header row. |
| <app-card-footer>default - | markup | - | Child slot rendering a footer row below the body. |
| <app-card-media>default - | markup | - | Child slot rendering a media band above the header. |
Screen reader
2 notes- A card given an onClick has role button and one tab stop, and Enter or Space runs the action; a card given an href is a link.
- The close button has an accessible name from closeLabel, and pressing it never runs the card's own action.
Do and avoid
2 pairsOne titled subject per card
Your plan renews on 12 Aug 2026.
One titled card, one coherent subject: the header tells the user what this block is.
Your plan renews on 12 Aug 2026.
3 new members joined this week.
Server Room assessment is overdue.
Three unrelated facts crammed into one untitled card, so none of them stands out.
Use body={false} for a table
| Corporate Office | Draft |
A table uses body={false} so its rows sit flush to the card edges.
| Corporate Office | Draft |
The default body padding leaves an awkward inset gap around a full-width table.