structyl

The full prop reference for the Card component. A container that groups related content and actions.

Import

tsx
import { Card } from '@structyl/styled';

Props

Root

Main card container. Renders a div with border, rounded corners, background styling, shadow, and transition effects. Supports all standard HTML div attributes plus forwardRef.

PropTypeDefault
className#string

Merges with default styling (rounded-xl border border-border bg-card text-card-foreground shadow-sm transition-shadow duration-smooth)

undefined
asChild#boolean

If true, renders as Primitive.div (headless primitive mode only applies to primitives package)

false
ref#React.Ref<HTMLDivElement>

Forward reference to the underlying div element

undefined
...rest#React.HTMLAttributes<HTMLDivElement>

All standard HTML div attributes (id, data-*, aria-*, onClick, onMouseEnter, style, etc.)

undefined

Header

Card header section. Renders a div with flex layout, vertical direction, small gap, and padding. Typically contains Title and Description.

PropTypeDefault
className#string

Merges with default styling (flex flex-col gap-1.5 p-6)

undefined
asChild#boolean

If true, renders as Primitive.div (headless primitive mode only applies to primitives package)

false
ref#React.Ref<HTMLDivElement>

Forward reference to the underlying div element

undefined
...rest#React.HTMLAttributes<HTMLDivElement>

All standard HTML div attributes (id, data-*, aria-*, onClick, onMouseEnter, style, etc.)

undefined

Title

Card title heading. Renders an h3 with large font size, semibold weight, and tight tracking.

PropTypeDefault
className#string

Merges with default styling (text-lg font-semibold leading-none tracking-tight)

undefined
asChild#boolean

If true, renders as Primitive.div (headless primitive mode only applies to primitives package)

false
ref#React.Ref<HTMLHeadingElement>

Forward reference to the underlying h3 element

undefined
...rest#React.HTMLAttributes<HTMLHeadingElement>

All standard HTML heading attributes (id, data-*, aria-*, onClick, style, etc.)

undefined

Description

Card description text. Renders a paragraph with small font size and muted foreground color.

PropTypeDefault
className#string

Merges with default styling (text-sm text-muted-foreground)

undefined
asChild#boolean

If true, renders as Primitive.div (headless primitive mode only applies to primitives package)

false
ref#React.Ref<HTMLParagraphElement>

Forward reference to the underlying p element

undefined
...rest#React.HTMLAttributes<HTMLParagraphElement>

All standard HTML paragraph attributes (id, data-*, aria-*, onClick, style, etc.)

undefined

Content

Card main content area. Renders a div with vertical padding (6 units bottom, 0 top) for spacing after header.

PropTypeDefault
className#string

Merges with default styling (p-6 pt-0)

undefined
asChild#boolean

If true, renders as Primitive.div (headless primitive mode only applies to primitives package)

false
ref#React.Ref<HTMLDivElement>

Forward reference to the underlying div element

undefined
...rest#React.HTMLAttributes<HTMLDivElement>

All standard HTML div attributes (id, data-*, aria-*, onClick, style, etc.)

undefined

Source code

If you didn't find what you need here, read the component implementation .

structyl — Accessible React Component Library