{"slug":"card","name":"Card","category":"Layout & Navigation","summary":"A bordered surface for grouped content and actions.","status":"stable","since":"0.1.0","import":"import { Card } from '@elluzion/iv-ui';","usage":["`title`, `description`, and `action` build the standard header; `header` replaces it.","Providing `onclick` makes the whole card a keyboard-reachable button.","`footer` renders below the body; `padding=\"none\"` lets lists manage their own spacing."],"props":[{"name":"title","type":"string","default":"''","description":"Title text.","required":false,"bindable":false},{"name":"description","type":"string","default":"''","description":"Supporting text.","required":false,"bindable":false},{"name":"padding","type":"'sm' | 'md' | 'lg' | 'none'","default":"'md'","description":"Inner padding. `none` is useful for lists that manage their own spacing.","required":false,"bindable":false},{"name":"radius","type":"'md' | 'lg'","default":"'md'","description":"Corner radius step.","required":false,"bindable":false},{"name":"hoverable","type":"boolean","default":"false","description":"Adds the hover treatment without making the card interactive.","required":false,"bindable":false},{"name":"selected","type":"boolean","default":"false","description":"Renders the selected treatment.","required":false,"bindable":false},{"name":"disabled","type":"boolean","default":"false","description":"Disables interaction and applies the disabled treatment.","required":false,"bindable":false},{"name":"className","type":"string","default":"''","description":"Extra classes merged onto the root element.","required":false,"bindable":false}],"events":[{"name":"click","type":"(e: MouseEvent) => void","default":null,"description":"Makes the card interactive and called on activation.","required":false,"bindable":false}],"snippets":[{"name":"children","type":"Snippet","default":null,"description":"Content rendered inside the component.","required":true,"bindable":false},{"name":"action","type":"Snippet","default":null,"description":"Slot in the header, right of the title.","required":false,"bindable":false},{"name":"header","type":"Snippet","default":null,"description":"Replaces the default header.","required":false,"bindable":false},{"name":"footer","type":"Snippet","default":null,"description":"Content rendered below the body.","required":false,"bindable":false}],"types":[],"manual":[],"tokens":["--iv_accent","--iv_accent-surface","--iv_border","--iv_border-focus","--iv_border-hover","--iv_card-pad-x","--iv_card-pad-x-lg","--iv_card-pad-x-sm","--iv_card-pad-y","--iv_card-pad-y-lg","--iv_card-pad-y-sm","--iv_cursor","--iv_disabled-opacity","--iv_ease-in-out","--iv_font-sans","--iv_font-ui","--iv_foreground","--iv_foreground-dim","--iv_hazard-stripe","--iv_radius","--iv_radius-lg","--iv_ring","--iv_ring-width","--iv_spacing-lg","--iv_spacing-sm","--iv_spacing-xs","--iv_surface-raised","--iv_text-base","--iv_text-label","--iv_transition-base"],"cssHooks":["iv-action","iv-body","iv-card","iv-clickable","iv-description","iv-disabled","iv-footer","iv-header","iv-header-text","iv-hoverable","iv-pad-lg","iv-pad-none","iv-pad-sm","iv-radius-lg","iv-selected","iv-title"],"accessibility":{"keyboard":[["Tab","Moves focus to an interactive card."],["Enter / Space","Activates an interactive card."]],"notes":["An interactive card gets `role=\"button\"`, `tabindex=\"0\"`, and `aria-disabled` when disabled.","Do not place buttons or links inside a card that is itself clickable; move them to `action` or `footer` and keep the card static.","`hoverable` changes only the visual treatment and does not make the card interactive."]},"related":[{"title":"Article","summary":"A readable page body with an optional title and standfirst.","url":"/components/article","kind":"Component"},{"title":"Accordion","summary":"A stack of collapsible sections; one or several can be open.","url":"/components/accordion","kind":"Component"},{"title":"EmptyState","summary":"Explains why an area has no content and offers the next step.","url":"/components/empty-state","kind":"Component"},{"title":"Separator","summary":"A hairline rule that separates content.","url":"/components/separator","kind":"Component"}],"examples":[{"id":"basic","title":"Basic","description":"A title, description, and body content.","code":"<script lang=\"ts\">\n\timport { Card } from '@elluzion/iv-ui';\n</script>\n\n<Card title=\"Edge cache\" description=\"Hit rate across the last 24 hours.\">\n\t<p class=\"body\">98.4% of requests were served from the nearest edge.</p>\n</Card>\n\n<style>\n\t.body {\n\t\tmargin: 0;\n\t\tfont-family: var(--iv_font-mono);\n\t\tfont-size: var(--iv_text-body);\n\t\tcolor: var(--iv_foreground-dim);\n\t}\n</style>"},{"id":"header-action","title":"Header action","description":"`action` places a control at the trailing edge of the header.","code":"<script lang=\"ts\">\n\timport { Button, Card } from '@elluzion/iv-ui';\n\n\tlet refreshed = $state(0);\n</script>\n\n<Card title=\"Deployments\" description=\"The last three runs for this project.\">\n\t{#snippet action()}\n\t\t<Button size=\"sm\" variant=\"ghost\" onclick={() => refreshed++}>Refresh</Button>\n\t{/snippet}\n\t<p class=\"body\">Refreshed {refreshed} times.</p>\n</Card>\n\n<style>\n\t.body {\n\t\tmargin: 0;\n\t\tfont-family: var(--iv_font-mono);\n\t\tfont-size: var(--iv_text-body);\n\t\tcolor: var(--iv_foreground-dim);\n\t}\n</style>"},{"id":"interactive","title":"Interactive","description":"`onclick` adds the button role, tab stop, and keyboard activation.","code":"<script lang=\"ts\">\n\timport { Card } from '@elluzion/iv-ui';\n\n\tlet opened = $state(0);\n</script>\n\n<Card\n\ttitle=\"Open the runbook\"\n\tdescription=\"Click anywhere on the card, or focus it and press Enter.\"\n\thoverable\n\tonclick={() => opened++}\n>\n\t<p class=\"body\">Opened {opened} times.</p>\n</Card>\n\n<style>\n\t.body {\n\t\tmargin: 0;\n\t\tfont-family: var(--iv_font-mono);\n\t\tfont-size: var(--iv_text-body);\n\t\tcolor: var(--iv_foreground-dim);\n\t}\n</style>"},{"id":"states","title":"States","description":"Selected, hoverable, and disabled treatments.","code":"<script lang=\"ts\">\n\timport { Card } from '@elluzion/iv-ui';\n</script>\n\n<div class=\"grid\">\n\t<Card title=\"Selected\" description=\"Chosen in the current step.\" selected>\n\t\t<p class=\"body\">Reverse-video border and cursor marker.</p>\n\t</Card>\n\t<Card title=\"Hoverable\" description=\"Hover is visual only.\" hoverable>\n\t\t<p class=\"body\">No button role, no tab stop.</p>\n\t</Card>\n\t<Card title=\"Disabled\" description=\"Interaction is blocked.\" disabled onclick={() => {}}>\n\t\t<p class=\"body\">Still readable.</p>\n\t</Card>\n</div>\n\n<style>\n\t.grid {\n\t\tdisplay: grid;\n\t\tgrid-template-columns: repeat(auto-fit, minmax(200px, 1fr));\n\t\tgap: var(--iv_spacing-md);\n\t\twidth: 100%;\n\t}\n\n\t.body {\n\t\tmargin: 0;\n\t\tfont-family: var(--iv_font-mono);\n\t\tfont-size: var(--iv_text-sm);\n\t\tcolor: var(--iv_foreground-dim);\n\t}\n</style>"}],"markdown":"/components/card.md","page":"/components/card"}