Dashral Pro is on the wayGet 30% off at launch

Dashral

Alert

A callout that draws attention to important information.

$ pnpm dlx shadcn@latest add https://dashral.com/r/alert.json
Scheduled maintenance
The dashboard will be unavailable on Sunday from 01:00 to 02:00 UTC.

Installation

$ pnpm dlx shadcn@latest add https://dashral.com/r/alert.json

Adds the component, the components it builds on, its npm packages and the theme tokens it uses. Using Dashral often? Add the registry to components.json once:

components.json
{
  "registries": {
    "@dashral": "https://dashral.com/r/{name}.json"
  }
}

Then add components by name:

$ pnpm dlx shadcn@latest add @dashral/alert

Usage

example.tsx
import { Alert } from "@/components/dashral/alert"

<Alert color="success" title="Payment received" description="Invoice INV-1048 is paid." />

Examples

Colors and variants

Each color brings a fitting icon; variant is soft, outline or solid.

New feature
Data tables now support column visibility.
Payment received
Invoice INV-1048 has been paid.

Action and close

action sits at the end; onClose adds a close button.

Your trial ends in 3 days
Upgrade to keep your dashboards and data.
Tip
Press ⌘K anywhere to search.

Form error summary

After a failed submit it lists every problem, takes the focus, and each line jumps to its field.

API reference

Alert

Also takes every prop of <div>(opens in a new tab).

PropTypeDefault
title / descriptionReactNode

The headline and the detail (which can hold links and lists).

—
color"neutral" | "primary" | "info" | "success" | "warning" | "destructive" | "highlight"

What it means; each color brings a fitting icon.

"neutral"
variant"soft" | "outline" | "solid"

How much it stands out.

"soft"
iconReactNode | false

Replaces the icon; false shows none.

the color's
actionReactNode

At the end, e.g. a button.

—
onClose() => void

Shows a close button.

—
closeLabelstring

The close button's accessible name, in your language.

"Dismiss"
childrenReactNode

More content under the description.

—
classNames{ icon, title, description, action }

Classes for each part.

—
classNamestring

Extra classes, merged with cn() so yours win.

—

Accessibility

  • Warnings and errors are role="alert", announced when they appear; the rest are role="status".
  • Each color has its own icon and the alert a title, so meaning never relies on color alone. The close button is labelled “Dismiss” (closeLabel).