- Home
- Design system
- Elements
- Card
Card
Options
Basic usage
Size
Indent
ds-card supports global indents
Gap
Visual states
Component color
Card supports component color classes.
Loading state
A card can be triggered to display a loading state - where the card contents are hidden, and the replaced by a centered spinning loading icon – without affecting the dimensions of the card.
Additional options are available using Message state
Message state
Message state extends and can be used with Loading state. If a card has a data-attribute data-ds-message the card contents are hidden, and replaced by an icon and the text of the data-ds-message.
Footer
Card with close button
Styles
Custom styles exist for specific use cases.
Default style
Details style
The details style apply some additional styling rules:
Connected style
When cards are placed inside a ds-cols --connected element, they will have visual connectors applied between elements.
The connectors are styled according to the following rules:
Panel style
Panel style sets a minimum width (260px), height (140px), and adds a hover state shadow.
Uniform style
Cards within a ds-cols container with the ds-cols --uniform class have a consistent minimum width of 320px and dynamically widen to fit available space, or wrap to the next row. Cards share a consistent horizontal grid alignment for each row - so that each element in the card will maintain the same vertical height as it’s adjacent card.
The minimum width can be set by setting the --ds-cols-width CSS variable. For example, to set the minimum width to 300px, add the following style attribute to the card element: style="--ds-cols-width: 200px;"
Cards using uniform style must have a consistent number of child elements. If a specific child element has no content, it should be output as an empty element with no content, and should not be omitted from the DOM.