Utility
AI
Terminal
alert-demo
No opentui live preview is registered for this example yet.
Installation
pnpm dlx shadcn@latest add @termcn/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
No opentui live preview is registered for this example yet.
Warning
Use variant="warning" to display a warning alert.
Terminal
alert-warning
No opentui live preview is registered for this example yet.
Without Border
Set bordered={false} to remove the border.
Terminal
alert-no-border
No opentui live preview is registered for this example yet.
Custom Icon and Color
Override the icon and color with icon and color props.
Terminal
alert-custom
No opentui live preview is registered for this example yet.
API Reference
Alert
| Prop | Type | Default |
|---|---|---|
variant | "success" | "error" | "warning" | "info" | "info" |
title | string | undefined |
children | ReactNode | undefined |
icon | string | undefined |
bordered | boolean | true |
borderStyle | "single" | "double" | "round" | "bold" | "singleDouble" | "doubleSingle" | "classic" | undefined |
color | string | undefined |
paddingX | number | 1 |
paddingY | number | 0 |