Skip to content
Alea0.1

Layout

Card

The Alea panel: a rounded surface with a soft ring. Deep, outline and interactive versions.

Ant Design: Card

import { Card, CardTitle, CardDescription, CardLink } from '@alea/ui';

Examples

Variants

Default with the soft ring, deep for inset areas, outline for quiet grouping.

Default

The Alea panel.

Deep

An inset area.

Outline

Just a border.

Interactive card

Lifts and glows on hover. One CardLink makes the whole card clickable with one tab stop.

New

Mode Matrix

Every mode of a screen side by side, each copy checked for contrast.

Open Mode Matrix

Padding

tight, normal (default) and loose.

Tight

Normal

Loose

Props

Card props

The Alea panel: rounded surface with the soft inner ring.

PropTypeDefaultDescription
asElementType'div'The element to render. Default div; use article or section when it fits.
interactiveboolean-Lifts and glows on hover; use when the whole card is a link (put the link inside with CardLink).
padding"none" | "tight" | "normal" | "loose"'normal'tight uses less padding and a smaller radius.
variant"default" | "deep" | "outline"'default'default: the surface with the soft ring; deep: a darker inset panel; outline: border only.

CardTitle props

Card title in Crimson Pro.

PropTypeDefaultDescription
asElementType'h3'The heading element. Default h3; match the page outline.

CardDescription props

Card body text, muted.

PropTypeDefaultDescription
aria-labelstring-Defines a string value that labels the current element. @see aria-labelledby. (React Aria)
autoFocusboolean- (React Aria)
classNamestring- (React Aria)
defaultValuestring | number | readonly string[]- (React Aria)
idstring- (React Aria)
inputMode"none" | "search" | "text" | "tel" | "url" | "email" | "numeric" | "decimal"-Hints at the type of data that might be entered by the user while editing the element or its contents @see {@link https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute} (React Aria)
onChangeChangeEventHandler<HTMLElement, Element>- (React Aria)
onSubmitSubmitEventHandler<HTMLElement>- (React Aria)
roleAriaRole- (React Aria)
styleCSSProperties- (React Aria)

Accessibility

  • An interactive card is made clickable by one real link inside (CardLink), so there is one tab stop and a clear name.

Do and don't

Do

  • Group one topic per card.
  • Use CardLink for cards that go somewhere.

Don't

  • Don't nest cards in cards; use deep for an inset area.
  • Don't put several links in an interactive card.

In Figma

Card with Variant (Default, Deep, Outline) and Padding (Tight, Normal, Loose).

Tested with axe, keyboard and screen reader roles