Feedback

Alert

Inline status message with assertive role for surfacing time-sensitive feedback about a nearby action or region.

import { Alert } from '@lostgradient/cinder/alert';
feedbacknotice
01

Overview

A status message that communicates contextual feedback and can optionally be dismissed.

Usage

svelte
<script lang="ts">
  import Alert from '@lostgradient/cinder/alert';
</script>

<Alert variant="success">Saved successfully.</Alert>
Live preview
02

When to use

Use when
  • Surfacing the result of a just-completed action such as a save failure or success.
  • Calling out a transient condition the user must notice immediately within a specific region.
Avoid when
  • Communicating a page- or app-wide notice that persists across views — use a banner instead.
  • Providing supplemental commentary or guidance inline with content — use a callout instead.
03

Examples

Dismissible alert

An alert with a close button that fires onDismiss.

Alert variants

Info, success, warning, and danger alerts.

Alert with icon

Custom icon slot alongside the alert message.

04

Props

Props for alert
Name Type Default Required Bindable Description
variant 'info''success''warning''danger''error' 'info'
dismissible boolean false
onDismiss () => void
children snippet req
icon snippet