Cards are versatile content structures that group related concepts and tasks together as well as provide an entry point to more complex and detailed information.
The card component is made up of nine elements.
- Media slot
- Header slot
- Default slot
- Footer slot
- Header divider
- Footer divider
The media slot allows any type of rich media to be placed at the top of the card. Media can include imagery, video embeds, map embeds, or data visualizations. Custom media layouts can be created and placed within the media slot.
The header slot is a container that is positioned at the top of the main content area and spans the full width of the card. A default layout includes a title and subtitle within the header slot, but it may be customized as needed.
The default slot is a basic container that sits between the header and footer and allows for complete customization of the card’s body content. Text styling is applied to the slot itself to allow for quick insertion of basic text content, but can accommodate a variety of custom layouts and configurations based on the content requirements.
The footer slot is positioned at the bottom of the content and allows for custom footer layouts. Default styling is applied to the slot to allow for consistent treatment of basic text.
Dividers can be independently added below the header and above the footer. This can help create clearer definition between complex body content and the rest of the card. The dividers can have insets applied to align them to card content as needed.
By default, cards have medium padding applied to slots to ensure content can be added without butting up against the edges of the container. A more modest padding can be applied using the small preset, while the padding surrounding the default slot can be completely removed with the none preset. Component tokens are available for fine-grain control of padding when needed.
All text within the card’s predefined slots automatically wraps to a new line and forces its containers to grow to fit it.
Media placed within the media slot scales according to its intrinsic aspect ratio. However, custom aspect ratios can be set via component token and media will scale to fill the container.
Cards grow in height to accommodate the content of the card.
The card component uses the following components: