AlertKind
AlertKind is the severity enum used by Alert.
It answers a product question, not only a color question: what kind of message is this? A good alert kind helps people judge urgency before they read every word.
Example
use fission::prelude::*;
let widget: Widget = Alert {
kind: AlertKind::Warning,
title: "Storage almost full".into(),
description: Some("Uploads may fail until space is cleared.".into()),
}
.into();
Choice table
| | | |
|---|
| | | Good for neutral guidance or status updates. |
| | Potential problem that needs attention soon. | Good when the user should notice risk before failure. |
| | Something failed or is invalid right now. | Use when the user needs to recover or change input. |
| | Positive confirmation that something worked. | Best for meaningful success, not every tiny action. |
Specific advice
Pick the kind based on product meaning, not aesthetics. If everything becomes a warning just because orange looks noticeable, users lose trust in the severity system.
Production checklist
For AlertKind, review the fields that change behavior before treating the widget as finished: Info, Warning, Error, Success. The goal is to make the product rule visible in state and actions, not hidden inside ad-hoc construction code.
If this widget appears inside an interactive flow, keep the surrounding action binding in the parent component and test that the flow still has one clear reducer path.
Check the semantics tree for the user-facing label or role that makes this widget understandable without relying only on pixels.
Add at least one component or harness test that confirms the visible text, semantic role, action dispatch, and layout constraint that matter for this widget in context.
If a screen starts repeating the same AlertKind setup, extract a named component around this widget. That keeps the reference API small while making product code easier to read and safer for generated code to copy.
Alert, ToastKind, Badge, and EmptyState.