Skip to content
Razor catalogue

On this page

@addTagHelper *, Webority.Ui.Razor

A basic card

A card is a padded surface around whatever you put inside it, so one section of a page reads as one unit.

Content on a surface
Put content inside; the card supplies the surface and the body padding.

Everything inside sits on one raised surface with consistent padding.

Show code
<app-card>
    <p class="mb-0">Everything inside sits on one raised surface with consistent padding.</p>
</app-card>

Long title with a button

A long title wraps beside the actions; the button keeps its width and its label stays on one line.

A long title beside a button
The title wraps onto a second line; the button keeps its width and its label stays on one line.
Business GSTINs linked to this account, one for each state where the firm trades and files returns

Two registrations are linked.

Show code
<app-card title="Business GSTINs linked to this account, one for each state where the firm trades and files returns">
    <app-card-actions>
        <app-button size="WideSize.Sm">Add GSTIN</app-button>
    </app-card-actions>
    <p class="mb-0">Two registrations are linked.</p>
</app-card>

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 display face on the title
--wui-card-title-font-family sets the title face and --wui-card-title-fw its weight, on the card itself.
Brand title face

The title reads in the product's display face.

Show code
<app-card title="Brand title face" data-wui-style="--wui-card-title-font-family: var(--wui-font-display); --wui-card-title-fw: 400">
    <p class="mb-0">The title reads in the product's display face.</p>
</app-card>

Variants

Flat is the default; elevated and outline stand off the page, filled recedes, and accent flags a status with a coloured stripe.

Five surface treatments
variant sets the surface treatment; on the accent variant, tone colours the left stripe.
Flat

Flat surface, no border.

variant=flat
Elevated

A firmer 1px edge.

variant=elevated
Outline

A heavier 2px border.

variant=outline
Filled

Recessed fill, all over.

variant=filled
Accent

Primary stripe.

variant=accent
Show code
<app-card variant="Flat" title="Flat">…</app-card>
<app-card variant="Elevated" title="Elevated">…</app-card>
<app-card variant="Outline" title="Outline">…</app-card>
<app-card variant="Filled" title="Filled">…</app-card>
<app-card variant="Accent" title="Accent">…</app-card>
Status cards
variant="accent" adds a left stripe; tone (success/warning/danger/info) colours it, so a card can flag its own state at a glance.
Compliant

All checks pass.

tone=success
Due soon

Renews in 3 days.

tone=warning
Overdue

Action required.

tone=danger
Show code
<app-card variant="Accent" tone="Success" title="Compliant">…</app-card>
<app-card variant="Accent" tone="Warning" title="Due soon">…</app-card>
<app-card variant="Accent" tone="Danger" title="Overdue">…</app-card>

Padding & width

Tune the inner spacing with padding, and cap a standalone card's width so it does not stretch across a wide page.

Padding scale
padding = none | sm | md (default) | lg. none is for edge-to-edge content that owns its own spacing.
padding=sm

Denser, good for tiles and widgets.

padding=lg

Roomier, good for a focal card.

Show code
<app-card padding="Sm" title="Compact">…</app-card>
<app-card padding="Lg" title="Roomy">…</app-card>
Capped, centred width
max-width takes a preset (xs/sm/md/lg) or a px value; the card caps at that width and centres in its container.
Confirm your email

A standalone card capped at a comfortable reading width instead of stretching across the page.

Show code
<app-card max-width="AppCardMaxWidth.Sm" title="Settings">…</app-card>

Media

A media band runs across the top of the card, the image-card pattern for previews and thumbnails.

A card with a top image
Put any markup in an app-card-media slot; the band clips to the card's rounded top corners.
Onboarding guide
5-minute read

Get your team set up in a few steps.

Show code
<app-card max-width="AppCardMaxWidth.Xs" title="Onboarding guide" subtitle="5-minute read">
    <app-card-media><div class="sc-media-band"></div></app-card-media>
    <p class="mb-0 text-body-secondary small">Get your team set up in a few steps.</p>
</app-card>

Clickable card

Give the card an href and the whole surface becomes one link, so it needs no nested links or buttons.

The whole card is the target
href renders the card as a link.
Show code
<app-card href="/report" variant="Outline" title="Open the report">
    <p class="mb-0 text-body-secondary small">The whole surface is a link.</p>
</app-card>

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.

A card with no body padding
With body="false" the content renders directly, so a table sits flush to the card edges.
BuildingStatus
Corporate OfficeDraft
Server RoomCompliant
Show code
<app-card body="false">
    <table class="table mb-0">
        <thead><tr><th>Building</th><th>Status</th></tr></thead>
        <tbody>
            <tr><td>Corporate Office</td><td>Draft</td></tr>
            <tr><td>Server Room</td><td>Compliant</td></tr>
        </tbody>
    </table>
</app-card>
A table inside a flush card
flush lets a table run to the card's edges and sit inside its rounded corners.
Buildings
BuildingStatus
Corporate OfficeDraft
Server RoomCompliant
Show code
<app-card flush="true" title="Buildings">
    <table class="table mb-0">
        <thead><tr><th>Building</th><th>Status</th></tr></thead>
        <tbody>
            <tr><td>Corporate Office</td><td>Draft</td></tr>
            <tr><td>Server Room</td><td>Compliant</td></tr>
        </tbody>
    </table>
</app-card>

Every option

Every value of every prop, one cell each.

children: the card content

children (required)
Children

Rendered inside the body.

variant: all five

variant="flat" (default)
Flat

Card content.

variant="elevated"
Elevated

Card content.

variant="outline"
Outline

Card content.

variant="filled"
Filled

Card content.

variant="accent"
Accent

Card content.

tone: accent variant, every tone

variant="accent" tone="primary" (default)
Primary

Stripe colour.

variant="accent" tone="success"
Success

Stripe colour.

variant="accent" tone="warning"
Warning

Stripe colour.

variant="accent" tone="danger"
Danger

Stripe colour.

variant="accent" tone="info"
Info

Stripe colour.

padding: every value

padding="none"
Padding

Body inset at none.

padding="sm"
Padding

Body inset at sm.

padding="md" (default)
Padding

Body inset at md.

padding="lg"
Padding

Body inset at lg.

maxWidth: every preset, a number and a string

max-width="xs"
max-width=xs

Capped and centred.

max-width="sm"
max-width=sm

Capped and centred.

max-width="md"
max-width=md

Capped and centred.

max-width="lg"
max-width=lg

Capped and centred.

max-width-px="480"
480px

max-width-px takes a whole number of pixels.

max-width-px="640"
40rem

A width in pixels: 40rem is 640px at 16px per rem.

title, subtitle and headerIcon: the header title area

title only
Title only

No subtitle, no icon.

subtitle only (no title)
Subtitle only

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
Security
Reviewed 2 days ago

The full title area.

titleFont: every value

title-font="sans" (default)
Sans title

The interface face.

title-font="serif"
Serif title

Drawn in the display typeface.

titleClassName: a class on the title

titleClassName (React only; Razor has no title class hook)
Title class

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
Team

Both share one header row.

headerExtra: content after the title

headerExtra (React only; Razor has no slot beside the title)
Team

Razor puts any badge inside the body instead.

header: fully custom

header (React only; Razor composes the header inside app-card)
Composed by hand

Title and actions are the Razor way to build the header.

footer & media

<app-card-footer> only
Invoice #1042

A row below the body.

<app-card-media> only

Media sits above the header.

media + header + footer together
Resource pack

All three bands stack in order.

href and onClick: clickable, or neither

(no href): plain div, not clickable
Static card

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)
Razor close

Pressing the close button removes the card.

dismissible="true": shows the close button; pressing it hides the card
Dismissible

A close button with no handler.

close-label: the close button's accessible name (no visible text)
Tip

Screen readers announce the button as Close tip.

body: padded or flush

body (default): padded
Padded

Standard card body inset.

body="false": content meets the edges
Flush
RowValue

className: classes on the outer box

class="border-primary" (React: className)
Outer class

The class lands on the card's outer box.

bodyClassName: classes on the body

bodyClassName (React only; Razor puts the class on the content)
Body class

The class sits on this paragraph.

headerClassName: classes on the header

headerClassName (React only; Razor has no header class hook)
Header class

The header keeps the default style.

lifted: hover lift

lifted (default): no hover lift
Static

Hover: no movement.

lifted="true": 1px hover translate
Lifted

Hover to see the lift.

flush and divided

flush="true": table meets the edges
Buildings
RowValue
divided="true": a rule under the header
Team

A rule sits under the header.

flush="true" divided="true"
Buildings
RowValue
(default): neither
Team

Padded body, no rule.

overflow: long content in a capped-width card

max-width="xs" with a long unbroken title and long body text
A surprisingly long card title that keeps going and going
And an equally long subtitle line that wraps too

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

Do
Billing

Your plan renews on 12 Aug 2026.

One titled card, one coherent subject: the header tells the user what this block is.

Avoid

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

Do
Corporate OfficeDraft

A table uses body={false} so its rows sit flush to the card edges.

Avoid
Corporate OfficeDraft

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.

sans serif
(none) settings shield-check building folder-open
flat elevated outline filled accent
primary success warning danger info
none sm md lg
(none) xs sm md lg
(none) 320 480 640
Team members
12 open items

Everything inside sits on one raised surface with consistent padding.

React, generated from the controls
<AppCard title="Team members" subtitle="12 open items" onClick={onClick}>
  <p className="mb-0">Everything inside sits on one raised surface with consistent padding.</p>
</AppCard>
Razor, the same props
<app-card title="Team members" subtitle="12 open items">
    <p class="mb-0">Everything inside sits on one raised surface with consistent padding.</p>
</app-card>

20 props. The 2 most used come first.

Used on most screens 2 props

PropTypeDefaultDescription
titledefault - string - Card heading; renders the header strip.
subtitledefault - string - A muted line under the title.

Less common 18 props

PropTypeDefaultDescription
(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 pairs

One titled subject per card

Do
Billing

Your plan renews on 12 Aug 2026.

One titled card, one coherent subject: the header tells the user what this block is.

Avoid

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

Do
Corporate OfficeDraft

A table uses body={false} so its rows sit flush to the card edges.

Avoid
Corporate OfficeDraft

The default body padding leaves an awkward inset gap around a full-width table.