Skip to content
THE COMPONENT LIBRARY
Skip to content

Component reference

Card

A composable surface for related content and actions.

Preview

Live preview

Changes apply to this preview only.

Loading the interactive example?

Width adapts to the available space

More examples

Different configurations and compositions using the real Pimolu API. Each preview runs independently and follows the site appearance.

Sizes

sm, md and lg scale the padding, the gap and the title.

Open preview

Variants

The semantic tone consumed by the outline and soft appearances.

Open preview

Appearances

Outline, soft, elevated and glass.

Open preview

Usage

Use CardHeader, CardTitle, CardDescription and CardContent to establish hierarchy. Card owns its padding; avoid adding an unintended second padding layer.

A Card is a div, not an interactive control. Put a real Button or Link inside it for an action, and choose a suitable heading level with CardTitle's as prop.

API reference

Generated from the public TypeScript declarations. Native HTML attributes are inherited where the component extends them; this reference includes Pimolu props and selected common native attributes.

PimoluCardProps

Type source
PimoluCardProps public API
NameTypeDefaultDescription
size"sm" | "md" | "lg" | undefined"md"Component size.
variant"primary" | "secondary" | "neutral" | "success" | "warning" | "danger" | undefined"neutral"Variant exposed by this component.
appearance"soft" | "outline" | "glass" | "elevated" | undefined"outline"Visual treatment of the control or surface.
fullWidthboolean | undefinedfalseUse the available width of the parent.
defaultValuestring | number | readonly string[] | undefined—Standard React/HTML attribute.
classNamestring | undefined—Standard React/HTML attribute.
styleCSSProperties | undefined—Standard React/HTML attribute.
aria-labelstring | undefined—Defines a string value that labels the current element.
childrenReactNode—Standard React/HTML attribute.
onChangeChangeEventHandler<HTMLDivElement, Element> | undefined—Standard React/HTML attribute.
onClickMouseEventHandler<HTMLDivElement> | undefined—Standard React/HTML attribute.
size

"sm" | "md" | "lg" | undefined

Default: "md"

Component size.

variant

"primary" | "secondary" | "neutral" | "success" | "warning" | "danger" | undefined

Default: "neutral"

Variant exposed by this component.

appearance

"soft" | "outline" | "glass" | "elevated" | undefined

Default: "outline"

Visual treatment of the control or surface.

fullWidth

boolean | undefined

Default: false

Use the available width of the parent.

defaultValue

string | number | readonly string[] | undefined

No default extracted.

Standard React/HTML attribute.

className

string | undefined

No default extracted.

Standard React/HTML attribute.

style

CSSProperties | undefined

No default extracted.

Standard React/HTML attribute.

aria-label

string | undefined

No default extracted.

Defines a string value that labels the current element.

children

ReactNode

No default extracted.

Standard React/HTML attribute.

onChange

ChangeEventHandler<HTMLDivElement, Element> | undefined

No default extracted.

Standard React/HTML attribute.

onClick

MouseEventHandler<HTMLDivElement> | undefined

No default extracted.

Standard React/HTML attribute.

PimoluCardHeaderProps

Type source
PimoluCardHeaderProps public API
NameTypeDefaultDescription
defaultValuestring | number | readonly string[] | undefined—Standard React/HTML attribute.
classNamestring | undefined—Standard React/HTML attribute.
styleCSSProperties | undefined—Standard React/HTML attribute.
aria-labelstring | undefined—Defines a string value that labels the current element.
childrenReactNode—Standard React/HTML attribute.
onChangeChangeEventHandler<HTMLDivElement, Element> | undefined—Standard React/HTML attribute.
onClickMouseEventHandler<HTMLDivElement> | undefined—Standard React/HTML attribute.
defaultValue

string | number | readonly string[] | undefined

No default extracted.

Standard React/HTML attribute.

className

string | undefined

No default extracted.

Standard React/HTML attribute.

style

CSSProperties | undefined

No default extracted.

Standard React/HTML attribute.

aria-label

string | undefined

No default extracted.

Defines a string value that labels the current element.

children

ReactNode

No default extracted.

Standard React/HTML attribute.

onChange

ChangeEventHandler<HTMLDivElement, Element> | undefined

No default extracted.

Standard React/HTML attribute.

onClick

MouseEventHandler<HTMLDivElement> | undefined

No default extracted.

Standard React/HTML attribute.

PimoluCardContentProps

Type source
PimoluCardContentProps public API
NameTypeDefaultDescription
defaultValuestring | number | readonly string[] | undefined—Standard React/HTML attribute.
classNamestring | undefined—Standard React/HTML attribute.
styleCSSProperties | undefined—Standard React/HTML attribute.
aria-labelstring | undefined—Defines a string value that labels the current element.
childrenReactNode—Standard React/HTML attribute.
onChangeChangeEventHandler<HTMLDivElement, Element> | undefined—Standard React/HTML attribute.
onClickMouseEventHandler<HTMLDivElement> | undefined—Standard React/HTML attribute.
defaultValue

string | number | readonly string[] | undefined

No default extracted.

Standard React/HTML attribute.

className

string | undefined

No default extracted.

Standard React/HTML attribute.

style

CSSProperties | undefined

No default extracted.

Standard React/HTML attribute.

aria-label

string | undefined

No default extracted.

Defines a string value that labels the current element.

children

ReactNode

No default extracted.

Standard React/HTML attribute.

onChange

ChangeEventHandler<HTMLDivElement, Element> | undefined

No default extracted.

Standard React/HTML attribute.

onClick

MouseEventHandler<HTMLDivElement> | undefined

No default extracted.

Standard React/HTML attribute.

PimoluCardFooterProps

Type source
PimoluCardFooterProps public API
NameTypeDefaultDescription
defaultValuestring | number | readonly string[] | undefined—Standard React/HTML attribute.
classNamestring | undefined—Standard React/HTML attribute.
styleCSSProperties | undefined—Standard React/HTML attribute.
aria-labelstring | undefined—Defines a string value that labels the current element.
childrenReactNode—Standard React/HTML attribute.
onChangeChangeEventHandler<HTMLDivElement, Element> | undefined—Standard React/HTML attribute.
onClickMouseEventHandler<HTMLDivElement> | undefined—Standard React/HTML attribute.
defaultValue

string | number | readonly string[] | undefined

No default extracted.

Standard React/HTML attribute.

className

string | undefined

No default extracted.

Standard React/HTML attribute.

style

CSSProperties | undefined

No default extracted.

Standard React/HTML attribute.

aria-label

string | undefined

No default extracted.

Defines a string value that labels the current element.

children

ReactNode

No default extracted.

Standard React/HTML attribute.

onChange

ChangeEventHandler<HTMLDivElement, Element> | undefined

No default extracted.

Standard React/HTML attribute.

onClick

MouseEventHandler<HTMLDivElement> | undefined

No default extracted.

Standard React/HTML attribute.

PimoluCardTitleProps

Type source
PimoluCardTitleProps public API
NameTypeDefaultDescription
as"h2" | "h3" | "h4" | "h5" | "h6" | undefined"h3"Underlying element or component.
defaultValuestring | number | readonly string[] | undefined—Standard React/HTML attribute.
classNamestring | undefined—Standard React/HTML attribute.
styleCSSProperties | undefined—Standard React/HTML attribute.
aria-labelstring | undefined—Defines a string value that labels the current element.
childrenReactNode—Standard React/HTML attribute.
onChangeChangeEventHandler<HTMLHeadingElement, Element> | undefined—Standard React/HTML attribute.
onClickMouseEventHandler<HTMLHeadingElement> | undefined—Standard React/HTML attribute.
as

"h2" | "h3" | "h4" | "h5" | "h6" | undefined

Default: "h3"

Underlying element or component.

defaultValue

string | number | readonly string[] | undefined

No default extracted.

Standard React/HTML attribute.

className

string | undefined

No default extracted.

Standard React/HTML attribute.

style

CSSProperties | undefined

No default extracted.

Standard React/HTML attribute.

aria-label

string | undefined

No default extracted.

Defines a string value that labels the current element.

children

ReactNode

No default extracted.

Standard React/HTML attribute.

onChange

ChangeEventHandler<HTMLHeadingElement, Element> | undefined

No default extracted.

Standard React/HTML attribute.

onClick

MouseEventHandler<HTMLHeadingElement> | undefined

No default extracted.

Standard React/HTML attribute.

PimoluCardDescriptionProps

Type source
PimoluCardDescriptionProps public API
NameTypeDefaultDescription
defaultValuestring | number | readonly string[] | undefined—Standard React/HTML attribute.
classNamestring | undefined—Standard React/HTML attribute.
styleCSSProperties | undefined—Standard React/HTML attribute.
aria-labelstring | undefined—Defines a string value that labels the current element.
childrenReactNode—Standard React/HTML attribute.
onChangeChangeEventHandler<HTMLParagraphElement, Element> | undefined—Standard React/HTML attribute.
onClickMouseEventHandler<HTMLParagraphElement> | undefined—Standard React/HTML attribute.
defaultValue

string | number | readonly string[] | undefined

No default extracted.

Standard React/HTML attribute.

className

string | undefined

No default extracted.

Standard React/HTML attribute.

style

CSSProperties | undefined

No default extracted.

Standard React/HTML attribute.

aria-label

string | undefined

No default extracted.

Defines a string value that labels the current element.

children

ReactNode

No default extracted.

Standard React/HTML attribute.

onChange

ChangeEventHandler<HTMLParagraphElement, Element> | undefined

No default extracted.

Standard React/HTML attribute.

onClick

MouseEventHandler<HTMLParagraphElement> | undefined

No default extracted.

Standard React/HTML attribute.

Accessibility

  • Use headings that match the surrounding document structure.
  • Do not add click handlers to the card surface as a substitute for an accessible control.
Read the accessibility guide →