Card
A box that groups related content. It is purely visual and does not change how content is read.
Storage
12 GB of 50 GB used
12 GB of 50 GB used
Flat card
Usage
Web (React)
<DotwearCard>
<h2>Storage</h2>
<p>12 GB of 50 GB used</p>
</DotwearCard>
<DotwearCard variant="flat">Nested</DotwearCard>
iOS (SwiftUI)
VStack(alignment: .leading, spacing: 8) {
Text("Storage").font(.headline)
Text("12 GB of 50 GB used")
}
.dotwearCard() // .outlined (border + shadow)
Text("Nested")
.dotwearCard(.flat) // border only
Variants
| Variant | Use for |
|---|---|
outlined | Border and shadow (default) |
flat | Border only — e.g. a card inside a card |
States
| State | Appearance |
|---|---|
| — | A card has no states. To make it tappable, put a standard button or link inside it |
React API
| Prop | Description |
|---|---|
variant="outlined" | "outlined" (default), "flat" |
…div props | Any <div> attribute |
SwiftUI API
| API | Description |
|---|---|
.dotwearCard(_ variant: = .outlined) | variant: .outlined .flat |
Accessibility
- The card does not group or rename its content; screen readers read the children as they are.
- Web: use a real heading (<h2> etc.) for the card title.