AlertPro
A persistent message that helps people recover or continue: tone icon, title and details; dismissing collapses its height; tone and copy changes morph in place.
oxyn add alerterror[E0308]: mismatched types --> src/auth/session.rs:42:18 | 42 | let token: Token = refresh().await; | ^^^^^ expected `Token`, found `Result<Token, Error>`
Content below closes the gap when the alert is dismissed.
The preview stays free for everyone. Pro opens the code of every Pro component, screen, agent-app template, block and kit, plus the Pro CLI.
Rendered from Rust at build time · goes live when visible
When to use
- A message that stays until it is dealt with: a failed deploy with Retry and logs, a context window nearly full, an archived workspace.
- It sits in the flow of the page, not over it.
When not to use
- Calm toasts from anywhere: use Toaster instead.
- Notice cards stacked behind each other: use Notification Stack instead.
- A small status label that carries the colour: use Badge instead.
Installation
Alert is part of Oxyn Pro; the preview is free. Pro items install with the oxyn CLI once your licence is signed in; until then Pro members copy the code from this page.
oxyn add alertUsage
The preview is free. Pro opens the code of every Pro component, screen and template.
Examples
Agent error
Retry, logs and details.
error[E0308]: mismatched types --> src/auth/session.rs:42:18 | 42 | let token: Token = refresh().await; | ^^^^^ expected `Token`, found `Result<Token, Error>`
Content below closes the gap when the alert is dismissed.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Success
A quiet confirmation.
Content below closes the gap when the alert is dismissed.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Warning
Context almost full.
Content below closes the gap when the alert is dismissed.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Agent
The agent's identity colour.
Content below closes the gap when the alert is dismissed.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Outline
Monochrome outline.
Content below closes the gap when the alert is dismissed.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
API reference
Alert
| Prop | Type | Default | Description |
|---|---|---|---|
titlerequired | String | — | Headline. |
tone | String | "info" | `info` · `success` · `warning` · `danger` · `agent`. |
body | Option<String> | Default::default() | Details under the title. |
open | bool | true | Shown (presence). |
dismissible | bool | Default::default() | Dismiss button. |
actions | Vec<String> | Default::default() | Action buttons. |
details | Option<String> | Default::default() | Collapsible technical details. |
variant | String | "soft" | `soft` · `outline` · `solid`. |
on_dismiss | EventHandler<()> | — | Dismissed. |
on_action | EventHandler<String> | — | Action pressed. |
Read from the Rust signature and doc comments.
Keyboard interactions
| Key | Action |
|---|---|
| EnterorSpace | Dismiss, actions and Show logs |
Accessibility
- Danger is role=alert; the rest role=status.
- The dismiss button is named "Dismiss: <title>"; the icon is decorative.
From the spec
Danger is role=alert, the rest role=status, so tone changes are announced with the right urgency. The icon is decorative; the dismiss button reads "Dismiss: <title>". Colour is never the only signal: each tone has its own icon.
Motion & interaction
The icon pops in when the tone changes; the copy rises out of a 3 px blur when it changes. Dismissing collapses the height so content below closes the gap. Details open with a height transition.
Timing
| Transition | Duration | Easing | Reduced motion |
|---|---|---|---|
| Icon morph | 260 ms | ease.out | swap |
| Copy change | 220 ms | ease.out | swap |
| Collapse | 320 ms | ease.out | instant |
| Details | 260 ms | ease.out | instant |
Responsive behaviour
- Fills its container; the copy wraps, the icon and button keep their size.
Edge cases (spec)
Long titles wrap; details scroll inside 140 px. Changing tone while collapsing reopens with the new tone. Inside narrow panels the actions wrap below.
Notes for AI
- Import
Alertfromoxyn_dioxusand includePRIMITIVES_CSSplus the token stylesheet once. - A GPUI version exists:
AlertElinoxyn_gpui. - Props to set first:
title. - Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.