Skip to content
kitn AI/UI

Card

kai-card

The shared card chrome all generative-UI cards build on — a themed Shadow DOM surface with heading, description, media, body, and actions slots.

  • Shadow DOM
  • Chrome only — no events
  • 4 scalar attributes
  • Media + actions slots
  • Shared error state

All four props are scalar attributes — set them as HTML attributes or DOM properties:

<kai-card heading="Workspace summary" description="Generated just now.">
<p>Your repository has 3 open pull requests and 12 passing checks.</p>
</kai-card>
  • Default slot — card body; any passive content.
  • slot="media" — full-width region above the heading; drop in an <img> or block element.
  • slot="actions" — footer for read-only metadata or status labels (not interactive controls).
  • error-message — replaces the body and actions with the shared inline error UI; remove the attribute to restore the normal view.
<kai-card heading="Quarterly report" description="Generated just now.">
<img slot="media" src="/preview.png" alt="Report preview" />
<p>Your Q2 numbers are ready to review.</p>
</kai-card>

slot="actions" — passive metadata such as timestamps or file sizes in the card footer.

Set error-message to render the shared inline error treatment — body and actions are replaced.

dense tightens spacing — useful in a tight list or feed of multiple cards.

PropertyTypeDefaultNotes
heading Heading rendered in the card chrome (= CardEnvelope.title). Attribute: `heading`.
description Supporting text under the heading. Attribute: `description`.
errorMessage When set, the card renders its inline error state instead of the body. Attribute: `error-message`.
dense false Compact spacing for dense lists. Attribute: `dense`.

This element wraps these SolidJS components — reach for them directly when you need finer control than the props expose.

Card