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
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

VariantUse for
outlinedBorder and shadow (default)
flatBorder only — e.g. a card inside a card

States

StateAppearance
—A card has no states. To make it tappable, put a standard button or link inside it

React API

PropDescription
variant="outlined""outlined" (default), "flat"
…div propsAny <div> attribute

SwiftUI API

APIDescription
.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.