KANTO DS v1.12.0
Customise

Theme

Accent

Font

Corners

Density

Text size

Reset to Kanto
Core

kt-card

GitHub Copy link

The system's content surface: 12px radius, a 1px --border-subtle border, 24px of padding, 20px between its rows. Transparent at rest — a card reads as a grouping, not as an elevation.

Preview

Revenue
$24,892
+12.4% this month
Entity 4812
Clickable — try it with the keyboard.

The system's content surface: 12px radius, a 1px --border-subtle border, 24px of padding, 20px between its rows. Transparent at rest — a card reads as a grouping, not as an elevation.

<kt-card> <h6 slot="header">Recent transactions</h6> <kt-table></kt-table> <kt-button slot="footer" variant="text">View full history</kt-button> </kt-card>

Empty header and footer slots collapse, so an omitted footer costs no gap.

Clickable cards

<kt-card clickable>Entity 4812</kt-card>

clickable gives the card role="button", a tab stop, hover and active states, and Enter/Space activation, then fires kt-card-click. The div-with-a-click-handler it replaces did none of that.

Do not nest interactive elements inside a clickable card — a button inside a button is invalid, and the two hit targets fight. Either the card is the control, or the things inside it are.

Selected cards

selected marks a card as chosen — one filter of several, a picked plan:

<kt-card clickable selected>Pending</kt-card>

It tints the card, outlines it in the primary colour and sets aria-pressed, so the state is announced and not merely drawn.

Pair it with clickable. A card the user cannot toggle has no business looking toggled, so a selected card that is not clickable gets the styling but no aria-pressed — there is nothing to press, and claiming otherwise would be a lie to a screen reader.

The outline lives on the card's own box rather than on the host element. An outline only follows a border-radius declared on the same element, and the host has none — put one on the host and you get sharp corners around a rounded card.

Media

image is the convenience path; the media slot takes anything else.

<kt-card image="/preview.png" image-alt="Preview" image-position="top" image-size="160px"></kt-card> <kt-card image-position="right" image-size="200px"> <canvas slot="media"></canvas> Monthly breakdown </kt-card>

image-size sets the width for left/right and the height for top/bottom.

API

PropertyAttributeTypeDefault
clickableclickablebooleanfalse
selectedselectedbooleanfalse
imageimagestring''
imageAltimage-altstring''
imagePositionimage-position'left' | 'right' | 'top' | 'bottom''left'
imageSizeimage-sizestring'120px'
SlotDescription
defaultCard body
headerAbove the body
footerBelow the body
mediaReplaces the image attribute
EventDetailFired when
kt-card-click—A clickable card is activated. Cancelable.
PartDescription
baseThe card container
mediaThe image or media well
bodyHeader/content/footer column