You are currently on Anvil1, which is now in maintenance mode. Visit Anvil2 to get the latest version of the design system.
components / Structure

Card

Basic Card

The most basic implementation of a card takes up the entire room available on the page. This is useful for dividing content on the page into easy to digest sections or calling attention to a specific grouping of content.

Stack of Cards

Cards can easily be paired with the Stack to produce columns of Cards.

Card Shape Variations

Cards can be modified to suit the needs of the page by adding one or more variations. These variations can be mixed together to make the Card fit the layout.

Elevations

Default

Raised

Adds a shadow, bringing prominence to a particular Card.

Removes Border

Use to de-emphasize content relative to other Cards.

Sharper Edges

By default, Cards have a rounded style. Sharper edges can also be applied, generally when a Card is nested in another Card to keep corners smooth.

Padding

Cards can have three different padding options: default, thin, and none.

Thin Cards

The space inside a Card section can be decreased, which is useful in denser page layouts.

No Padding Cards

Useful when content inside needs to line up with external content, or to heavily customize inner Card content.

Card example combining many variations

Card States

Active

Shows that the content has been currently selected or enabled.

Error

Used to visually indicate that something is wrong with content inside. In general, error styling should be applied directly to content inside the Card, and only to the Card itself when it is directly an interactive piece. See the Togglebox as a practical example.

Placeholder Cards

Cards can be used to provide the user a clear indication of how to add content and how that content will affect the layout.

Clickable Card

Cards have a hover state automatically by adding an onClick prop. The hover state transitions the card to the next highest elevation as a click affordance. You can also set hoverable on the card. The active prop gives the card a blue outline indicating it has been selected.

Card Sections

Card Sections can be used to divide cards into multiple sections. Card Sections can have different background colors to divide a card header from the body of the card, or add a call to action button

By default, the Card content is automatically wrapped with a Card.Section. If you manually include Card.Sections in the card, those will be used instead.

Examples


Importing

import { Card } from '@servicetitan/design-system';