Components/Feedback/Alert
COMPONENT49.49

Alert

Callout for user attention: heading plus paragraph in a role="alert" region, with optional icon and trailing action.


INSTALL

1pnpm dlx @sayagodev/mo add alert

Or import the files from the package (no copy):

1import "@sayagodev/mo/css/alert.css";

EXAMPLES

Default

Heads up!

You can add components to your app using the CLI — or just plain HTML.

With icon

Payment successful

Your payment of $29.99 has been processed. A receipt has been sent to your email address.

New feature available

We've added dark mode support. You can enable it in your account settings.

Destructive

Payment failed

Your payment could not be processed. Please check your payment method and try again.

With action

Dark mode is now available

Enable it under your profile settings to get started.

Colors

Your subscription will expire in 3 days.

Renew now to avoid service interruption or upgrade to a paid plan to continue using the service.

Status extensions

Saved

Your changes were synced to the workspace.

Storage almost full

You have used 92% of your quota.

Basic

Account updated successfully

Your profile information has been saved. Changes will be reflected immediately.

Dialog Basic

Are you absolutely sure?

This action cannot be undone. This will permanently delete your account and remove your data from our servers.

Dialog Demo

Are you absolutely sure?

This action cannot be undone. This will permanently delete your account from our servers.

Dialog Destructive

Delete chat?

This will permanently delete this chat conversation. View Settings to delete any memories saved during this chat.

Dialog Media

Share this project?

Anyone with the link will be able to view and edit this project.

Dialog RTL

هل أنت متأكد تمامًا؟

لا يمكن التراجع عن هذا الإجراء. سيؤدي هذا إلى حذف حسابك نهائيًا من خوادمنا.

السماح للملحق بالاتصال؟

هل تريد السماح لملحق USB بالاتصال بهذا الجهاز؟

Dialog Small Media

Allow accessory to connect?

Do you want to allow the USB accessory to connect to this device?

Dialog Small

Allow accessory to connect?

Do you want to allow the USB accessory to connect to this device?

RTL

تم الدفع بنجاح

تمت معالجة دفعتك البالغة 29.99 دولارًا. تم إرسال إيصال إلى عنوان بريدك الإلكتروني.

ميزة جديدة متاحة

لقد أضفنا دعم الوضع الداكن. يمكنك تفعيله في إعدادات حسابك.

USAGE

1<div role="alert">2  <svg/>                 <!-- optional icon opens 2-col grid -->3  <h4>Title</h4>            <!-- col 2, medium weight -->4  <p>Description</p>        <!-- col 2, muted -->5  <div><button class="xs">Action</button></div>6</div>7 8<div role="alert" data-variant="danger"></div>

API

NAMEKINDDESCRIPTION
role="alert"attributeRequired — selects the component
[data-variant]attributedanger matches shadcn destructive; success/warning/info are extensions
> svgelementFirst child icon switches to grid-cols auto 1fr
> div:has(> button) / > buttonelementTrailing action, absolute top-right; button reuses button.css (e.g. .xs)
--mo-alert-*tokenpadding and radius hooks

FILES

src/css/alert.css
Install:mo add alert

THEMING · PLAYGROUND

This is the exact component from the examples above, wearing a completely different theme. Edit the tokens and --mo-* hooks in the editor — autocomplete knows them all — and the preview obeys in real time. Your CSS always wins.

Tokens & hooks — edit live
Global tokens
--border--card--card-foreground--destructive--muted-foreground--radius--success--warning
Component hooks
--mo-alert-padding--mo-alert-radius

Preview

Chequeo completado

Los 12 módulos reportan dentro de tolerancia. Próxima revisión: 14:00.

Your CSS

Try it: type --mo- for the component hooks, or edit any value — the preview obeys in real time.