{"slug":"alert","name":"Alert","category":"Feedback & Status","summary":"An inline message for information, success, warning, or error.","status":"stable","since":"0.2.0","import":"import { Alert } from '@elluzion/iv-ui';","usage":["`type` sets the icon and accent; `error` maps to `role=\"alert\"`.","`dismissible` adds a close button wired to `ondismiss`.","Keep the body to a sentence or two; use `title` for the headline."],"props":[{"name":"type","type":"'info' | 'success' | 'warning' | 'error'","default":"'info'","description":"Status family; controls the icon and color treatment.","required":false,"bindable":false},{"name":"title","type":"string","default":"''","description":"Short headline for the message.","required":false,"bindable":false},{"name":"dismissible","type":"boolean","default":"false","description":"Shows a close button.","required":false,"bindable":false},{"name":"className","type":"string","default":"''","description":"Extra classes merged onto the root element.","required":false,"bindable":false}],"events":[{"name":"dismiss","type":"() => void","default":null,"description":"Called when the close button is pressed.","required":false,"bindable":false}],"snippets":[{"name":"children","type":"Snippet","default":null,"description":"Message body.","required":false,"bindable":false}],"types":[],"manual":[],"tokens":["--iv_border","--iv_error","--iv_error-surface","--iv_font-sans","--iv_font-ui","--iv_foreground","--iv_foreground-dim","--iv_info","--iv_info-surface","--iv_leading-base","--iv_leading-tight","--iv_outline-offset","--iv_outline-width","--iv_radius-sm","--iv_spacing-lg","--iv_spacing-md","--iv_spacing-sm","--iv_spacing-xl","--iv_success","--iv_success-surface","--iv_surface-overlay","--iv_surface-raised","--iv_text-body","--iv_text-sm","--iv_weight-semibold"],"cssHooks":["iv-alert","iv-alert-body","iv-alert-close","iv-alert-content","iv-alert-error","iv-alert-icon","iv-alert-info","iv-alert-success","iv-alert-title","iv-alert-warning"],"accessibility":{"notes":["Error alerts use `role=\"alert\"`; the other types use `role=\"status\"`.","The icon is decorative and hidden from assistive technology.","The close button has an accessible name and a visible focus ring."]},"related":[{"title":"Toast","summary":"A single transient notification driven by the toast store.","url":"/components/toast","kind":"Component"},{"title":"EmptyState","summary":"Explains why an area has no content and offers the next step.","url":"/components/empty-state","kind":"Component"},{"title":"Badge","summary":"A compact label for status, counts, or categories.","url":"/components/badge","kind":"Component"},{"title":"Card","summary":"A bordered surface for grouped content and actions.","url":"/components/card","kind":"Component"}],"examples":[{"id":"types","title":"Types","description":"Info, success, warning, and error share one layout.","code":"<script lang=\"ts\">\n\timport { Alert } from '@elluzion/iv-ui';\n</script>\n\n<div class=\"stack\">\n\t<Alert type=\"info\" title=\"Scheduled maintenance\">\n\t\tThe edge network is read-only on Sunday from 02:00 to 03:00 UTC.\n\t</Alert>\n\t<Alert type=\"success\" title=\"Deploy complete\">Version 0.2.0 is live in all three regions.</Alert>\n\t<Alert type=\"warning\" title=\"Token expires soon\">The deploy token expires in six days.</Alert>\n\t<Alert type=\"error\" title=\"Build failed\">\n\t\tThe type check reported two errors in the docs package.\n\t</Alert>\n</div>\n\n<style>\n\t.stack {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tgap: var(--iv_spacing-md);\n\t\twidth: 100%;\n\t}\n</style>"},{"id":"dismissible","title":"Dismissible","description":"The close button calls `ondismiss`; the parent removes the alert.","code":"<script lang=\"ts\">\n\timport { Alert, Button } from '@elluzion/iv-ui';\n\n\tlet visible = $state(true);\n</script>\n\n<div class=\"stack\">\n\t{#if visible}\n\t\t<Alert\n\t\t\ttype=\"info\"\n\t\t\ttitle=\"New version available\"\n\t\t\tdismissible\n\t\t\tondismiss={() => (visible = false)}\n\t\t>\n\t\t\tReload to pick up the latest build.\n\t\t</Alert>\n\t{:else}\n\t\t<Button size=\"sm\" variant=\"outline\" onclick={() => (visible = true)}>Restore alert</Button>\n\t{/if}\n</div>\n\n<style>\n\t.stack {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\talign-items: start;\n\t\tgap: var(--iv_spacing-md);\n\t\twidth: 100%;\n\t}\n</style>"},{"id":"body","title":"Body only","description":"A title is optional; children carry the message.","code":"<script lang=\"ts\">\n\timport { Alert } from '@elluzion/iv-ui';\n</script>\n\n<Alert type=\"warning\">This project uses 92% of its monthly build minutes.</Alert>"}],"markdown":"/components/alert.md","page":"/components/alert"}