Utility
Terminal
█
alert-demo █
Loading preview... █
█
█
█
█
█
█
█
█
█
█
█
█
█
█
█Installation
$ pnpm dlx shadcn@latest add @termcn/opentui/alert
Usage
import { Alert } from "@/components/ui/alert";<Alert variant="success" title="Build complete">
Everything is ready to ship.
</Alert>Examples
Error
Use variant="error" to display an error alert.
Terminal
█
alert-error █
Loading preview... █
█
█
█
█
█
█
█
█
█
█
█
█
█
█
█Warning
Use variant="warning" to display a warning alert.
Terminal
█
alert-warning █
Loading preview... █
█
█
█
█
█
█
█
█
█
█
█
█
█
█
█Without Border
Set bordered={false} to remove the border.
Terminal
█
alert-no-border █
Loading preview... █
█
█
█
█
█
█
█
█
█
█
█
█
█
█
█Custom Icon and Color
Override the icon and color with icon and color props.
Terminal
█
alert-custom █
Loading preview... █
█
█
█
█
█
█
█
█
█
█
█
█
█
█
█API Reference
Alert
| Prop | Type | Default |
|---|---|---|
variant | "success" | "error" | "warning" | "info" | "info" |
title | string | - |
children | ReactNode | - |
icon | string | - |
bordered | boolean | true |
borderStyle | "single" | "double" | "round" | "bold" | "singleDouble" | "doubleSingle" | "classic" | - |
color | string | - |
paddingX | number | 1 |
paddingY | number | 0 |