Skip to content
Dalvan UI

Card

Group related content and actions in a single surface.

Website redesign

The updated component guides are ready for review.
Updated today
<article class="dv-card">
  <header class="dv-card__header"><h4 class="dv-m-0">Website redesign</h4></header>
  <div class="dv-card__body">The updated component guides are ready for review.</div>
  <footer class="dv-card__footer"><span class="dv-muted">Updated today</span></footer>
</article>

Usage

After setting up the CSS, apply dv-card to the container and dv-card__body to the content section. Use an <article> for self-contained content or a <div> for a visual grouping.

<article class="dv-card">
  <div class="dv-card__body">Project summary</div>
</article>

Examples

Sections and actions

Use the header for a heading, the body for the main content, and the footer for metadata or actions. Place each section directly inside the card and include the sections you need. Choose a heading level that fits the surrounding page.

<article class="dv-card">
  <header class="dv-card__header"><h4 class="dv-m-0">Project settings</h4></header>
  <div class="dv-card__body">Review the options for this project.</div>
  <footer class="dv-card__footer"><a href="#api">View card classes</a></footer>
</article>

Sizes

Medium is the default. Choose small for dense layouts or large for more space around each section. The parent layout controls the card width.

Size sm
Size md
Size lg
<article class="dv-card dv-card--sm">
  <div class="dv-card__body">Size sm</div>
</article>
<article class="dv-card dv-card--md">
  <div class="dv-card__body">Size md</div>
</article>
<article class="dv-card dv-card--lg">
  <div class="dv-card__body">Size lg</div>
</article>

Appearance and palette

Paper is the default appearance. Use subtle for a tinted surface or solid for a stronger emphasis. Plain, ghost, and text use transparent backgrounds at rest. Choose a palette independently of appearance or inherit the surrounding palette. The playground shows all six appearances and five palettes.

In progress
Complete
Review needed
<article class="dv-card dv-color-primary dv-appearance-subtle">
  <div class="dv-card__body">In progress</div>
</article>
<article class="dv-card dv-color-success dv-appearance-solid">
  <div class="dv-card__body">Complete</div>
</article>
<article class="dv-card dv-color-warning dv-appearance-plain">
  <div class="dv-card__body">Review needed</div>
</article>

Nested surfaces

A paper card on a paper surface uses the alternate paper background in browsers that support CSS style queries.

Project overview
Milestone summary
<article class="dv-card dv-appearance-paper">
  <div class="dv-card__body">Project overview
    <article class="dv-card">
      <div class="dv-card__body">Milestone summary</div>
    </article>
  </div>
</article>

API reference

OptionClassBehavior
Basedv-cardGroups content on a rounded surface. Defaults to paper and medium section padding.
Sectionsdv-card__headerdv-card__bodydv-card__footerOptional direct children. Each gets the same padding.
Sizedv-card--smdv-card--mddv-card--lgUse one to change section padding.
Appearancedv-appearance-paperdv-appearance-subtledv-appearance-soliddv-appearance-plaindv-appearance-ghostdv-appearance-textUse one to set the surface and foreground.
Palettedv-color-neutraldv-color-primarydv-color-successdv-color-warningdv-color-dangerUse one to set the palette. Omit it to use the surrounding palette.

Customization

Set --dv-card-padding on the card to override its section padding. Apply shared radius and surface tokens on a theme container to customize multiple cards.

Custom section spacing
<article class="dv-card dv-color-primary dv-appearance-subtle" style="--dv-card-padding: var(--dv-space-250);">
  <div class="dv-card__body">Custom section spacing</div>
</article>

CSS custom properties

PropertyEffect and defaults
--dv-card-paddingPadding on all sides of each section. Defaults to var(--dv-space-100) for sm, var(--dv-space-200) for md, and var(--dv-space-300) for lg.
--dv-radius-mdShared corner radius used by the card.
--dv-color-paper / --dv-color-paper-altShared backgrounds for paper and alternate paper surfaces.