Skip to main content

Card

import { Card } from "@study/ui"

White with a soft shadow – or in a course colour. Large cards at the top of a page may carry a gradient (glow) and grain (grain).

Result
Loading...
Live Editor
<div style={{ display: "grid", gap: 16, gridTemplateColumns: "repeat(auto-fit, minmax(240px, 1fr))" }}>
  <Card tone="blau" glow grain>
    <SectionHeader title="Today" description="3 dates" />
    <div style={{ width: 140, marginLeft: "auto" }}><Illustration kind="schreibtisch" /></div>
  </Card>
  <Card>
    <SectionHeader title="To do" action={<Chip tone="gruen">1 of 4</Chip>} />
  </Card>
</div>

Variants and states​

Light

White (default)
Course colour
With gradient and grain
Sunken – inside other cards
Dashed – a place to fill
Card as a link (lifts on hover)
Little padding

Dark

White (default)
Course colour
With gradient and grain
Sunken – inside other cards
Dashed – a place to fill
Card as a link (lifts on hover)
Little padding

When to use​

Control Engineering
To do
✓ DoCourse colour for things of a course; white for mixed things.
A
B
C
✗ Don'tGradient and grain on every card – then nothing is special any more.
  • A card that leads somewhere else: as={Link} and interactive. Then nothing else in it may be clickable – actions (⋯) sit next to it, not inside.
  • No cards in cards in cards. Inside: variant="sunken" or a List with variant="raised".

Props​

Plus all props of the element from as.

PropTypeDefaultMeaning
asElementType–The element, e.g. `section`, `article`, `li` or a router `Link` for a card that leads somewhere. Default `div`.
glowboolean–A soft light from one corner, for the large cards at the top of a page. Only with `tone`.
grainboolean–A faint paper grain. Only on the one or two cards that lead a page.
interactiveboolean–Lifts slightly on hover; for cards that are links.
padding"sm" | "md" | "lg" | "none"md
tone"blau" | "petrol" | "gruen" | "gelb" | "orange" | "rot" | "violett" | "grau"–A tinted card in a subject colour; without it the card is white with a soft shadow.
variant"surface" | "sunken" | "outline"surfacesunken – a quiet grey ground for things inside other cards; outline – only a dashed line, for places to fill.

Accessibility​

  • Choose the right element: section with a heading, article, li in lists.
  • Text on course colours always uses ink – the card sets this itself.