Skip to main content
Mantı UI logoMantı UIv0.12.1
Studio

Alert

Alert supports primary, secondary, success, info, and danger. It uses role="status" by default and role="alert" for danger.

import { Alert } from '@manti-ui/react';

const variants = ['primary', 'secondary', 'success', 'info', 'danger'] as const;

export default function AlertVariants() {
  return (
    <div className="grid gap-3 w-full">
      {variants.map((variant) => (
        <Alert key={variant} variant={variant} title={`${variant} message`}>
          A smooth, colored status message that calmly explains what happened.
        </Alert>
      ))}
    </div>
  );
}

Dismissal

Provide onDismiss to show a close button. Your application owns whether the Alert remains rendered.

Dough is resting
Give it 30 minutes before you start rolling.

API

PropTypeDefaultDescription
variantAlertVariant'secondary'Semantic treatment: primary, secondary, success, info, or danger.
titleReactNodeBold leading line.
iconReactNodeLeading status icon.
onDismiss() => voidShow a close button and handle dismissal.
role'status' | 'alert'Auto-escalates to alert for the danger variant.
actions / footerReactNodeOne or more product actions rendered below the description.

Styling

Anatomy

PartSelectorDescription
root[data-scope="alert"][data-part="root"]The alert container.
icon[data-scope="alert"][data-part="icon"]Leading status icon.
content[data-scope="alert"][data-part="content"]Title + description wrapper.
title[data-scope="alert"][data-part="title"]The bold leading line.
description[data-scope="alert"][data-part="description"]Supporting copy.
actions[data-scope="alert"][data-part="actions"]Product actions or footer content.
dismiss[data-scope="alert"][data-part="dismiss"]Close button (when onDismiss).

Tokens

TokenControls
--manti-alert-radiusradius
--manti-alert-padding-xpadding x
--manti-alert-padding-ypadding y
--manti-alert-gapgap
--manti-alert-icon-sizeicon size
--manti-alert-dismiss-sizedismiss size
--manti-alert-font-sizefont size

Last updated

Built end-to-end with Manti UI components and design tokens. Manti UI is a framework-agnostic design system on Zag.js.

GitHub