Alert · callouts
Callouts with a title, text, actions and hidden details — four looks, a dismiss that folds the alert away, a controlled open state and an auto-close countdown that waits while you read.
variant for the four below
A new version is available
Reload to get the latest features and fixes.
Changes saved
Your profile was updated a moment ago.
Your trial ends in 3 days
Add a payment method to keep your projects.
Payment failed
The card was declined. Try another one.
Actions · details · dismiss
Unsaved changes
You have edits that haven't been published yet.
Build failed
esbuild stopped on 1 error.
✘ [ERROR] Could not resolve "./components/stock.js"
app.entry.js:42:24:
42 │ import { Mkt } from "./components/stock.js";
╵ ~~~~~~~~~~~~~~~~~~~~~~~Tip
Dismiss me — I fold away and the content below slides up.
Controlled · auto-close · compact
open is a signal; this one closes itself after 6 s — hover to hold it
Invite sent
[email protected] will get an email in a minute.
Compact · neutral · outline — for quiet notes in dense layouts.
Usage
import { signal } from "./index.js";import { Alert } from "./components/alert.js"; // kind: "info" | "success" | "warn" | "error" | "neutral"// variant: "soft" (default) · "outline" · "accent" · "solid"Alert({ kind: "success", title: "Changes saved", children: "Your profile was updated." }) // buttons under the text; the first is the main one, in the kind's colourAlert({ kind: "warn", title: "Unsaved changes", actions: [ { label: "Publish", onClick: publish }, { label: "Discard", onClick: discard },] }) // a cause behind "Show details"Alert({ kind: "error", title: "Build failed", details: log }) // dismissing folds it away — then onClose runsAlert({ kind: "info", children: "Tip", onClose: () => showTip.set(false) }) // controlled, and closing itself after 6 s (hover / focus holds the countdown)const open = signal(true);Alert({ kind: "success", open, autoClose: 6000, title: "Invite sent" })