iced-cube

Feedback

Alert

An inline callout with a title, description and icon.

use iced_cube::alert;
use iced_cube::feedback::alert::Variant;
API reference
Variants: Info, success, warning and destructive callouts.Variants: Info, success, warning and destructive callouts.
Static preview
Variants. Info, success, warning and destructive callouts.

Usage

Alerts sit in the flow of the page and stay until the content around them changes. Use them for messages that relate to what is on screen, such as a failed sync or a setting that needs attention.

Each variant has a default icon: info, a tick, a warning triangle and an exclamation mark. Status variants tint their background and border with the matching theme colour, while Info stays neutral.

Examples

Custom icon

Any Lucide icon in place of the variant's default.

Custom icon: Any Lucide icon in place of the variant's default.Custom icon: Any Lucide icon in place of the variant's default.
Static preview

API

ItemDescription
alert(title)Creates an alert with a title. It fills the available width.
.description(text)Adds supporting text under the title.
.variant(Variant)Info, Success, Warning or Destructive. Defaults to Info.
.icon(glyph)Replaces the variant's default icon with any Lucide icon.
.width(length)Overrides the width.
Esc