Skip to content

Card

Card groups related content on one surface: an optional cover, a header with a title, extra content and a close button, then the content, a footer and an action strip. Other props go to the root element.

Demos

Basic

A title makes the card a section named by its heading.

Size

size sets the padding and the title size: small, medium, large or huge.

Cover

cover sits above the header, edge to edge, such as an image.

Hoverable

hoverable lifts the card under the pointer: a soft shadow in Elegant, a longer ink shadow in Brutal.

headerExtra sits at the end of the header, footer under the content and action in a strip on a quieter surface at the bottom.

Bordered

bordered={false} drops the border (and Brutal’s shadow). A ConfigProvider’s bordered sets the default.

Segmented

segmented draws lines between the parts. true divides them all; an object picks the parts, and "soft" keeps a line inside the padding.

Closable

closable adds a × button to the header that calls onClose. The card does not hide itself.

No title

Without a title, header extra or close button there is no header.

Scrollable content

With contentScrollable and a height on the card, only the content scrolls, in a ScrollArea; the header and footer stay put.

Embedded

embedded uses a quieter surface, for a card inside another surface.

Semantics

tag picks the element (section for a titled card, div otherwise) and titleLevel the heading level (h3 by default). A titled section, article or aside is named by its title.

Part styles

Each part takes a class name and a style.

Card Props

NameTypeDefaultDescriptionVersion
titleReactNodeundefinedThe heading; it also names the card.Unreleased
titleLevel1 | 2 | 3 | 4 | 5 | 63The title’s heading level.Unreleased
tagsection | article | aside | divsection with a title, else divThe element to render.Unreleased
children / contentReactNodeundefinedThe content; children override content.Unreleased
coverReactNodeundefinedAbove the header, edge to edge.Unreleased
headerExtraReactNodeundefinedAt the end of the header.Unreleased
footerReactNodeundefinedUnder the content.Unreleased
actionReactNodeundefinedA bottom strip on a quieter surface.Unreleased
sizesmall | medium | large | hugemediumPadding and title size.Unreleased
borderedbooleantrueShows a border; defaults to ConfigProvider’s bordered.Unreleased
hoverablebooleanfalseLifts the card under the pointer.Unreleased
embeddedbooleanfalseUses a quieter surface.Unreleased
segmentedboolean | CardSegmentedfalseLines between the parts.Unreleased
closablebooleanfalseAdds a × button to the header.Unreleased
onClose(event: MouseEvent<HTMLButtonElement>) => voidundefinedRuns when × is clicked.Unreleased
contentScrollablebooleanfalseOnly the content scrolls; give the card a height.Unreleased
headerClassName / headerStylestring / CSSPropertiesundefinedClass and style of the header.Unreleased
headerExtraClassName / headerExtraStylestring / CSSPropertiesundefinedClass and style of the header extra.Unreleased
contentClassName / contentStylestring / CSSPropertiesundefinedClass and style of the content.Unreleased
footerClassName / footerStylestring / CSSPropertiesundefinedClass and style of the footer.Unreleased

CardSegmented

NameTypeDescription
contentboolean | "soft"The line between the header and the content.
footerboolean | "soft"The line above the footer.
actionbooleanThe line above the action area.

title, headerExtra, cover, footer and action all take a ReactNode. The close button is always reachable by keyboard.