@antadesign/anta
    Preparing search index...

    Interface CardPropsUnreviewed

    Common props for JSX component wrappers.

    interface CardProps {
        header?: ReactNode;
        subtitle?: ReactNode;
        icon?:
            | string & {}
            | string
            | number
            | bigint
            | boolean
            | ReactElement<unknown, string | JSXElementConstructor<any>>
            | Iterable<ReactNode, any, any>
            | ReactPortal
            | Promise<AwaitedReactNode>
            | null;
        footer?: ReactNode;
        media?: ReactNode;
        mediaPosition?: "top" | "bottom" | "left" | "right";
        children?: ReactNode;
        tone?:
            | "neutral"
            | "brand"
            | "info"
            | "success"
            | "warning"
            | "critical"
            | string & {};
        priority?: "primary"
        | "secondary"
        | "tertiary";
        size?: "small" | "medium" | "large";
        selected?: boolean;
        loading?: boolean;
        round?: boolean | number | string;
        href?: string;
        target?: string;
        rel?: string;
        ping?: string;
        className?: string;
        style?: CSSProperties;
        id?: string;
        title?: string;
        slot?: string;
        tabIndex?: number;
        key?: string | number | null;
        [key: `data-${string}`]: unknown;
        [key: `aria-${string}`]: unknown;
    }

    Hierarchy (View Summary)

    Indexable

    • [key: `data-${string}`]: unknown

      Any data-* attribute is forwarded to the rendered element.

    • [key: `aria-${string}`]: unknown

      Any aria-* attribute is forwarded to the rendered element.

    Index
    header?: ReactNode

    Header content, in the top zone. A string is wrapped in a <Title> — a real heading in the document outline, tinted to match tone, at a level that tracks size (small → 5, medium → 4, large → 3). Pass your own node (<Title level={2}>, an <h2>) for a different level or styling. Omit for no header.

    subtitle?: ReactNode

    A secondary line under the header title, rendered as smaller text (<Text size="small">) in the heading section. Tinted to match tone, like the title. Omit for no subtitle.

    icon?:
        | string & {}
        | string
        | number
        | bigint
        | boolean
        | ReactElement<unknown, string | JSXElementConstructor<any>>
        | Iterable<ReactNode, any, any>
        | ReactPortal
        | Promise<AwaitedReactNode>
        | null

    Leading visual for the header, laid out to the left of the header / subtitle as one aligned row (so it doesn't sit inline in the title, where it mis-aligns). A string is an icon shape, rendered as an <Icon> inside a circular chip (sized per the card via --card-icon-size); pass an <img>, initials (<Text>), or any node to use it as-is. Omit for none.

    footer?: ReactNode

    Footer content, usually action buttons. Rendered as a left-aligned row (wraps under pressure) — the opposite of Dialog's right-aligned footer.

    media?: ReactNode

    Media (image, illustration) rendered full-bleed to the card edge, clipped to its corners. Position it with mediaPosition.

    mediaPosition?: "top" | "bottom" | "left" | "right"

    Which edge the media bleeds to.

    'top'
    
    children?: ReactNode

    The card body. A string is wrapped in a <Text> at secondary priority, following the card's tone and size; pass your own nodes to take over.

    tone?:
        | "neutral"
        | "brand"
        | "info"
        | "success"
        | "warning"
        | "critical"
        | string & {}

    Semantic tone, or any literal CSS color ('#ff1493', 'rebeccapurple') for a one-off custom tone. Named tones re-point the surface + text; a custom color keeps its hue while lightness/chroma are pinned. 'neutral' (the default) is the same as omitting it.

    'neutral'
    
    priority?: "primary" | "secondary" | "tertiary"

    Surface emphasis. primary (the default) is a clean sheet; secondary is a subtle fill; tertiary is a frosted, semi-transparent panel with a backdrop blur.

    'primary'
    
    size?: "small" | "medium" | "large"

    Size variant — scales the padding.

    'medium'
    
    selected?: boolean

    Selected / chosen state — draws an inset ring in the tone color, for choice-card / plan-picker patterns.

    loading?: boolean

    Loading state — dims the card with a skeleton pulse, sets aria-busy, and (in link mode) blocks navigation.

    round?: boolean | number | string

    Fully-round corners (border-radius: 999px, clamped to the box). Pass a number (px) or a CSS length string ('1rem') for a custom radius. Omit for the default --card-radius.

    href?: string

    Turn the whole card into a link. The card renders a focusable anchor and its accessible name comes from header → body → this URL (override with aria-label). A link card is display content — don't nest interactive controls inside it.

    target?: string

    Anchor target (only with href).

    rel?: string

    Anchor rel (only with href).

    ping?: string

    Space-separated URLs the browser pings on navigation (only with href).

    className?: string

    CSS class on the component's root element (merged with the component's own classes). Use it directly for layout and positioning — grid/flex placement, margins, alignment — rather than wrapping the component in a <div>/<span>.

    style?: CSSProperties

    Inline styles on the component's root element. Set layout/positioning here (or via className) directly on the component instead of adding a wrapper.

    id?: string

    HTML id attribute.

    title?: string

    HTML title attribute — native browser tooltip on hover.

    slot?: string

    Assigns the element to a named <slot> of a parent web component (e.g. slot="header" inside a <Card>, slot="footer" inside a <Dialog>).

    tabIndex?: number

    Tab order. Set to -1 to skip the element when tabbing.

    key?: string | number | null

    React/Preact reconciliation key when rendered inside a list. Consumed by the JSX runtime (not forwarded as a DOM attribute).