Card
A Card concisely introduces a subject and its related actions.
- Useful links:
Make simple Cards clickable by wrapping the title in CardActionArea.
For different configurations, see Examples.
Use cases
Section titled “Use cases”Make sure the Card is suitable for your use case. There may be other, more appropriate components available.
| Use case | Card | Tabs | Dialog |
|---|---|---|---|
| Introduce a single subject, as one of a set displayed as a list or grid | ✅ | ❌ | ❌ |
| Divide a single subject into subsections to be switched between | ❌ | ✅ | ❌ |
| Present additional actions for a subject that require immediate attention | ❌ | ❌ | ✅ |
StrataKit MUI modifications
Section titled “StrataKit MUI modifications”Cardis rendered as an<article>element by default. This programmatically indicates the bounds of the Card’s contents.CardHeader’stitleis rendered as an<h2>by default.CardActionAreahas been redesigned to no longer wrap the entire card content. Instead, it should be used in the Card’s title.
Examples
Section titled “Examples”Actions
Section titled “Actions”Add multiple actions, at the foot of the Card, with the CardActions component.
Menu and metadata
Section titled “Menu and metadata”Add metadata and a Menu to CardHeader using the subheader and action props.
Heading levels
Section titled “Heading levels”Use slotProps to give the CardHeader’s title an appropriate heading level. The second level (<h2>) is the default.
<CardHeader title={ <CardActionArea render={<a href="#" />} nativeButton={false}> Stadium </CardActionArea> } slotProps={{ title: { render: <h3 /> }, }}/>- Choose an appropriate heading level for the
CardHeadertitle. - Organize multiple Cards into an unordered list, where each list item contains a single Card.
- Use
CardActionAreawhen there is only a single action and the entire card should be clickable. - Use
CardActionswhen the Card has multiple actions.
🚫 Don’t
Section titled “🚫 Don’t”- Don’t use a Card to group unrelated content or actions.
- Don’t use Card just to highlight some content belonging to a larger subject.
- Don’t wrap the entire contents of the Card in a
CardActionArea. Typically, it should be passed into theCardHeader’stitle.