Skip to content
GitHub (opens in a new tab)

ModalCard

The panel chrome for a modal: one shared header and footer.

stableOrganismcontracts/modalcard.json

Preview

ModalCard

Panel chrome for a modal. Not Card. Not InsightCard. Overlay behavior is Modal.

Master

The panel on the canvas: medium, with a description and close. No overlay.

Settings · Profile

Edit profile

Make changes to your profile here.

Update the name and email on this profile. Changes apply on save.

Usage

Modal always composes ModalCard. Use ModalCard on its own in the catalog, or when a surface needs the same chrome without an overlay. Use Card for a page tile.

Do's

  • The surface inside a Modal
  • Showing modal sizes in the catalog without an overlay

Don'ts

<ModalCard
  eyebrow="Settings · Profile"
  title="Edit profile"
  description="Make changes to your profile here."
  size="md"
  onClose={close}
  footerStart={<Button appearance="outline" mode="neutral" size="sm" iconStart="MessageCircle">Ask about this</Button>}
  footer={
    <>
      <Button appearance="outline" mode="neutral" size="sm">Cancel</Button>
      <Button appearance="solid" mode="primary" size="sm">Save</Button>
    </>
  }
>
  Update the name and email on this profile. Changes apply on save.
</ModalCard>

The panel chrome for a modal: one shared header (tone icon + eyebrow, Close, h2 title, description) and footer (footerStart left, actions right). Modal, AlertDialog and the AppShell work panel render it; Drawer uses the same header and footer. Not a page Card.

When to use

  • The surface inside a Modal
  • Showing modal sizes in the catalog without an overlay

When not to use

  • Page tile — use Card
  • One KPI — use Scorecard
  • Recommended insight — use InsightCard
  • Overlay behavior — use Modal
  • Must-choose confirm — use AlertDialog

What an agent reads

import { ModalCard } from "agentic-ds-kit";
must
  • role=group when standalone
  • Inside Modal: role=dialog, aria-modal=true, tabIndex=-1; inside AlertDialog: role=alertdialog, aria-modal=true, tabIndex=-1
  • Title is an h2 (18px, weight 550) and the accessible name via aria-labelledby
  • description (one sentence, 14px) is aria-describedby when present
  • Tone icon and the Close glyph are aria-hidden; the tone shows as a word too (Warning · Integrations)
  • Close is a kit IconButton named Close (KitLabels close), only when onClose is set
  • footerStart sits before the actions in the tab order
  • Unique ids via useId
  • built-in labels (close, info, success, warning, danger) come from KitLabelsProvider; English by default
defaults
  • role group
  • tone neutral
  • size md
stops if
  • Do not invent local ModalCard, Dialog, or DialogContent
  • Do not use raw hex
  • Do not use Card, Scorecard, or InsightCard as modal chrome
  • Do not add a footer divider of your own: ModalCard draws one only while the body scrolls
  • Footer actions must be kit Buttons / ButtonGroup
  • Do not put more than one primary (or danger) Button in the footer

From contracts/modalcard.json: must is the a11y requirements, defaults the prop defaults, stops if the doNot rules where the agent asks instead of inventing a cousin.

Props

NameTypeRequiredDefaultNotes
rolestringNogroupModal sets dialog. Leave the default when ModalCard is static.
tabIndexnumberNo—Modal sets -1 so the dialog can take focus.
aria-modaltrue | falseNo—Modal sets true.
titlestringYes——
descriptionstringNo——
eyebrowstringNo—Short area name in the header row, 12px, like Billing · Invoices. Caller-provided.
toneenumNoneutralTone icon (16px, aria-hidden) and status word from KitLabels (info, success, warning, danger) before the eyebrow, so status is never colour alone. neutral shows the eyebrow only. neutral | info | success | warning | danger
sizesm | md | lgNomdWidth sm 352 (22rem, 16 padding), md 448 (28rem, 24), lg 576 (36rem, 24). Radius 16 (surfaceLg) on every size.
onClosefunctionNo—Close only when provided: a 32px ghost neutral IconButton named Close (KitLabels close), on the right of the eyebrow row, or of the title row when there is no eyebrow.
childrenslotNo—Body
footerslotNo—kit Buttons / ButtonGroup, size sm: Cancel, then one primary (or danger) last on the right.
footerStartslotNo—Left of the footer actions, first in the footer tab order: an Ask Button (appearance outline, mode neutral, size sm, iconStart MessageCircle) or a count like 6 of 6 selected. Labels are caller-provided.
  • Component
    →

    Card

    Framed tile with optional header, body, and footer actions.

  • Component
    →

    Scorecard

    one KPI with label, value, optional delta/trend/hint/badge

  • Component
    →

    InsightCard

    A recommended insight or opportunity as a compact card, with tone and optional actions.

  • Component
    →

    Modal

    Dismissible overlay for short tasks, forms, or extra detail.