edbnedbn/ui
Get Started
WelcomeWhy We're DifferentChoosing a VariantChangelogLicense
Components
OverviewAlert DialogCheckboxCollapsibleDialogFieldInputMenuNumber FieldPopoverProgressRadioScroll AreaSelectSeparatorSliderSwitchTabsToggleTooltip
Shared Components
InputTextareaCardAvatarTableAlert
BreadcrumbPagination
0installs
ComponentsMaps
GitHub stars
HomeDocsComponentsSharedAlert

On this page

Alert (Shared)

Feedback alerts with 5 variants: default, destructive, success, warning, and info. Supports title, description, and icon slots.

Default Alert
This is a default alert — check it out!

Overview

Alert uses cva for 5 color variants. SVG icons placed as direct children are automatically positioned with absolute left placement. The component sets role="alert" for accessibility.

Usage

import {
  Alert,
  AlertTitle,
  AlertDescription,
} from "@/components/ui/shared/alert"
<Alert variant="success">
  <AlertTitle>Success!</AlertTitle>
  <AlertDescription>Your changes have been saved.</AlertDescription>
</Alert>

Installation

Install via CLI

TypeScript
npx edbn-ui@latest add alert

Examples

Default

Heads up!
You can add components to your app using the CLI.

Destructive

Error
Something went wrong. Please try again.

Success

Saved!
Your preferences have been updated.

Warning

Warning
Your session is about to expire.

Info

Info
New features are available for your account.

API Reference

variant"default" | "destructive" | "success" | "warning" | "info"
="default"

Color variant for the alert

classNamestring

Additional CSS classes