datui
Color scheme

Data display

ContentCard

Card with an optional cover image, title, description and caption; optionally a button or link.

import { ContentCard } from "datui";

Playground

Card titleDescriptionCaption
<ContentCard title="Card title" description="Description" caption="Caption" variant="shadow" />

Examples

Content cards

Accessibility

  • With href renders <a>, with onClick a <button>, otherwise a <div>.
  • Image alt defaults to "" because the card text usually describes it.
  • disabled blocks activation.

API

ContentCard

Card with an optional cover image and text. With `onClick`/`href` the whole card is a button/link.

PropTypeDefaultDescription
activatedboolean—Keep the pressed look, e.g. for the active item of a list.
altstringImage alt text. Empty by default: the card's text usually describes it.
asElementType<any, keyof IntrinsicElements>—Element to render. Defaults to `a` with `href`, `button` with `onClick`, otherwise `div`.
captionReactNode—
classNamestring—
crossOriginCrossOrigin—
descriptionReactNode—
disabledboolean—
hrefstring—
imageObjectFitObjectFitcover
loading"eager" | "lazy"—
maxHeightnumber—Image max height in px.
overTitleReactNode—
referrerPolicyHTMLAttributeReferrerPolicy—
relstring—
sizesstring—
srcstring—
srcSetstring—
targetstring—
titleReactNode—
titleAsElementType<any, keyof IntrinsicElements>span
type"button" | "submit" | "reset"—
variant"shadow" | "tint" | "outline" | "outline-tint" | "plain"shadowCard surface.