Skip to content

Alert

The Alert component is used to display important information or messages to the user in a prominent callout box. It supports different styles to indicate the nature of the message (e.g., info, success, danger).

Since OrbitUI components are copied directly into your project, you’ll add the Alert component using the OrbitUI CLI:

Terminal window
npx orbitkit@latest add alert

Import the Alert, AlertTitle, and AlertDescription components and use them in your Astro components or pages:

The Alert component accepts the following props, which are based on the alertVariants defined using class-variance-authority:

PropTypeDefault
variantdefault, info, danger, success, warningdefault
roundednone,xs, sm, md, lg, xl, fulllg
sizexs, sm, md, lg, xlsm
directionrow, colcol
borderbooleantrue
classstring''

The AlertTitle component is used to provide a concise heading for the alert message.

This component accepts all the standard HTML attributes that a <p> element would.

The AlertDescription component contains the main content or detailed message of the alert.

Similar to AlertTitle, this component accepts all the standard HTML attributes that a <p> element would.