component

Card

props · 36 shown · 36 total

Appearance

  • "transparent" "surface.peak" "surface.hill" "surface.base" "surface.valley" "surface.ground"
    default surface.peak

    Surface background from the Panel scale (`surface.peak` → `surface.ground`, or `transparent`).

  • "none" "default" "bold" "muted" "accent"
    default none

    Border color at rest: `none`, `default`, `bold`, `muted`, or `accent`. The 1px line is always reserved when a border can appear, so changing it never shifts layout.

  • "inherit" "none" "default" "bold" "muted" "accent"

    Border color while the surface is `active` — the explicit form of the ring `activeEmphasis` would otherwise pick. It holds through hover, so a `borderInteract` color can't steal it. `inherit` keeps whatever `activeEmphasis` chose; `none` clears it.

  • "none" "default" "bold" "muted" "accent"

    Border color on hover and press: `none`, `default`, `bold`, `muted`, or `accent`. Composes with `border`, e.g. a muted line at rest that turns bold on hover.

  • CardContentSurface

    Surface of the content region. Setting `content.background` switches the card into inset mode: the card becomes a shell (header and footer sit on it, a gutter surrounds everything) and the body renders as one inset panel with its own surface and a concentric radius. `content.padding` (`"none"` for edge-to-edge) also applies in flush mode.

  • "transparent" "surface.peak" "surface.hill" "surface.base" "surface.valley" "surface.ground"

    Shorthand for `content.background` — the inset content panel's fill. `content.background` wins when both are set.

  • boolean
    default false

    Draw hairline separators between the header, content and footer. Only applies in flush mode (an inset card already separates its content) and outside `rhythm` (a 1px rule would knock the card off the raster).

  • "primary" "secondary" "tertiary"
    default secondary

    Which surface ramp the panel paints with: `primary` is the filled feedback accent (with contrast text), `secondary` the feedback's own surface tint, `tertiary` the neutral ramp with feedback-accent text. `background` then picks the step on that ramp.

  • "primary" "inherit" "danger" "neutral" "success" "warning"
    default neutral

    Semantic color tone: `neutral`, `primary`, `success`, `warning`, `danger`, or `inherit`.

  • boolean
    default false

    Muted state — dims and desaturates the whole card (locked / inactive / unavailable). Purely visual; pair with `aria-disabled`/`inert` for semantics.

  • boolean
    default false

    Selected state — renders a dashed border. Only visible when the card also has a `border` (e.g. `border="default"`); the dashed style rides the existing ring rather than adding one.

  • "lg" "md" "sm" "xl" "xs" "none"

    Elevation shadow applied to the surface.

  • "lg" "md" "sm" "xs" "2xs"
    default "md"

    Controls the padding of the header, content, and footer sections (and the corner-overlay inset). Scales from `2xs` (densest) through `xs` / `sm` / `md` (default) to `lg` (most generous).

  • boolean
    default false

    Frosted glass: the chosen `background` step at /35 with a large backdrop blur, so content behind the panel shows through. A transparent background stays transparent.

Layout

  • "2xl" "lg" "md" "sm" "xl" "xs" "none" "10xl" "11xl" "2xs" "3xl" "3xs" "4xl" "4xs" "5xl" "6xl" "7xl" "8xl" "9xl"
    default none

    Inner padding from the spacing scale.

  • "inherit" "2xl" "lg" "md" "sm" "xl" "xs" "none" "2xs" "3xl" "4xl" "5xl" "6xl" "inner" "full"
    default md

    Corner radius from the radii scale (`full` for fully rounded). `inner` computes a concentric corner from the parent panel's radius minus its padding; `inherit` mirrors the parent's corner exactly, for a child that sits flush with its edge.

  • "inherit" "2xl" "lg" "md" "sm" "xl" "xs" "none" "2xs" "3xl" "4xl" "5xl" "6xl" "inner" "full"

    Corner radius for the bottom-left and bottom-right corners.

  • "inherit" "2xl" "lg" "md" "sm" "xl" "xs" "none" "2xs" "3xl" "4xl" "5xl" "6xl" "inner" "full"

    Corner radius for the top-left and bottom-left corners.

  • "inherit" "2xl" "lg" "md" "sm" "xl" "xs" "none" "2xs" "3xl" "4xl" "5xl" "6xl" "inner" "full"

    Corner radius for the top-right and bottom-right corners.

  • "inherit" "2xl" "lg" "md" "sm" "xl" "xs" "none" "2xs" "3xl" "4xl" "5xl" "6xl" "inner" "full"

    Corner radius for the top-left and top-right corners.

  • boolean

    Keep (or drop) the always-1px transparent border the panel reserves so a border appearing or changing never shifts layout. Computed automatically — it's reserved when a resting `border` is visible, or when `interactive` / `borderInteract` / `active` can change the border at runtime. Set `false` only on a panel that must not occupy that 1px (e.g. a borderless housing frame that would otherwise add 2px around a set).

  • boolean
    default false

    Opt the surface into the baseline rhythm. The root takes one whole raster line of padding on every edge and its text slots round their leading UP to a whole number of lines, so the box's height comes out as a whole number of lines without anyone setting a height. Inert when off — a surface rendered without it is byte-identical to before. An ancestor scope (a `<Grid rhythm>`, any `[data-rhythm]`) quantises the text without this prop; the prop is what also puts this box on the raster.

Behavior

  • boolean "current" "checked" "current-within"
    default false

    Mark this as the chosen one in a set (a current nav item, a checked option, a selected card). Where `interactive` says it *can* be clicked, `active` says it *is* the current choice. Use `activeEmphasis` to control how loud the state is. Combined with `interactive`, hover and press restart their stepping from the active baseline rather than falling back to the unchosen ramp. The four values differ only in what drives the state: `true` by the prop (via `data-panel-active`), `"checked"` by a wrapped native input (`:has(input:checked)` — zero JS, nothing to re-render), `"current"` by an existing `aria-current` on the panel, and `"current-within"` by an `aria-current` on a direct child (a split nav row whose link carries it).

  • "primary" "secondary" "tertiary"
    default the panel's `emphasis`

    How loud the `active` state is. Defaults to the panel's own `emphasis`, so the chosen state lands on the same ramp as the resting look — this prop is the override for when the active item should be louder (or quieter) than the panel itself. `"primary"` fills with the feedback accent ramp and flips text to the contrast scale (~150 RGB units of separation — the option that reads at a glance in a dense list). `"secondary"` tints the feedback surface ramp and `"tertiary"` the neutral ramp; both promote text to `bold` and lift the border to the default line, but move the surface only ~7–18 units.

  • "header" "footer" "div" "section" "article" "aside" "main" "nav" "dialog" "form" "fieldset" "ul" "ol" "li" "a" "button" "label" "span" "kbd"
    default "div"

    Root element tag. Set `"label"` to make the whole card a control.

  • boolean
    default false

    Enable interactive (hover / focus / press) affordances and states.

  • boolean
    default false

    Serialize the card's surface config into the rendered HTML so `updateCard()` can change `emphasis`/`feedback`/`background` (and the other surface axes) at runtime. Meant for Astro / vanilla JS, where props don't re-render; reactive frameworks don't need it.

Slots

  • children slot svelte
    Snippet

    The card body content.

  • corner slot svelte
    Snippet

    Absolutely-positioned top-right overlay; renders even without a header.

  • header svelte
    PrimitiveCardHeaderProps

    Header configuration — eyebrow/heading/subheading + leading/trailing snippets and an optional distinct surface, delegated to the inner Banner.

  • media svelte
    CardMediaConfig

    Media region — an image (or custom media snippet via `children`) placed full-bleed at the top/bottom, as a start/end column, or as a background cover behind the content.

Advanced

  • element binding svelte
    HTMLElement null

    The card's root DOM element — bind with `bind:element`.

  • "background" "bottom" "top" "end" "start"

    Layout hook for the media region — flips the root layout for `start`/ `end` columns and layers siblings for `background`. Set automatically by the high-level Card from `media.placement`; only set it manually when composing primitives.

  • string
    default "33%"

    Column width of a `start`/`end` media placement (any CSS length or percentage). Set automatically by the high-level Card from `media.width`.

  • CardPassThrough<RootElementAttributes>

    Per-slot style and attribute override bag. Each slot accepts `style` (a Panda CSS `SystemStyleObject`) and `props` (extra HTML attributes) merged onto the slot's element.

Plus all standard <div> HTML attributes.

Type

  • Components
  • Blocks