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
React Native
<DotwearCard>
<Text accessibilityRole="header">Storage</Text>
<Text>12 GB of 50 GB used</Text>
</DotwearCard>
<DotwearCard variant="flat">
<Text>Nested</Text>
</DotwearCard>
Flutter
DotwearCard(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Semantics(header: true, child: const Text('Storage')),
const Text('12 GB of 50 GB used'),
],
),
),
const DotwearCard(variant: DotwearCardVariant.flat, child: Text('Nested')),
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 |
React Native API
| Prop | Description |
|---|---|
variant="outlined" | "outlined" (default), "flat" |
…View props | Any View prop |
Flutter API
| Parameter | Description |
|---|---|
variant: DotwearCardVariant.outlined | .outlined (default), .flat |
child | The content, with 6 dots of padding |
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. React Native: give the title Text accessibilityRole="header". Flutter: wrap it in Semantics(header: true).