Alert
Callout banner for informational or destructive feedback.
Dual-mode build
Import coatx/styles.css for zero-compiler apps or compose StyleX maps directly.
Missing stylesheet
Include coatx/styles.css once at your application root.
Usage
import { alert, alertDescription, alertTitle } from "coatx/alert";
export const Notice = () => (
<div role="alert" {...alert({ variant: "destructive" })}>
<p {...alertTitle()}>Error</p>
<p {...alertDescription()}>Could not save settings.</p>
</div>
);
Exports (coatx/alert)
| Export | Description |
|---|---|
alert(options?) |
Alert container recipe |
alertTitle(options?) |
Alert heading slot |
alertDescription(options?) |
Alert copy slot |
alertStyles |
Compiled StyleX style map |
Options
| Option | Type | Default |
|---|---|---|
variant |
"default", "destructive" |
"default" |