Skip to content

Card ​

Card groups related content with optional cover, header, footer, and actions.

Demos ​

Basic

Use title for a simple header, or put custom markup in the header slot.
Card content goes in the default slot.

Cover

Set cover to an image URL for a built-in top image, or provide a cover slot (slot wins when present). Cover images use object-fit: cover with a max height.
Cover image from the cover attribute. Owl Cover from the cover slot (wins over cover attribute).

Size

Density via sm, md (default), and lg.
Compact padding and title.Default size.Roomier padding and title.

Hoverable

Enable hoverable for a soft shadow and slight translate on hover.
Hover for a subtle elevation nudge.

Segmented

segmented adds dividers between header, content, and footer when those regions exist.
Main content between header and footer.
Footer region

Closable

closable dispatches bubbling gk-close; the card does not hide itself. Here the host hides the card and shows a closable gk-alert.
Close this card to reveal an alert.

API ​

Card Props ​

PropTypeDefault
titlestring—
size'sm' | 'md' | 'lg''md'
coverstring—
hoverablebooleanfalse
borderedbooleantrue
segmentedbooleanfalse
closablebooleanfalse

Card Slots ​

NameDescription
coverCustom cover (wins over cover attribute)
headerCustom header (wins over title attribute)
defaultMain content
footerFooter region
actionTop-right actions (beside close when both present)

Card Events ​

NameDescription
gk-closeClose button activated; bubbles; composed: true

CSS Parts ​

PartDescription
baseOuter article surface
coverCover region
headerHeader row
contentMain content wrapper
footerFooter region
actionAction area (slot + close)
closeClose button