Displays a callout for user attention.
import { Alert } from "@ngrok/mantle/alert";
import { ShrimpIcon } from "@phosphor-icons/react/Shrimp";
<Alert.Root priority="danger">
<Alert.Icon />
<Alert.Content>
<Alert.Title>Danger</Alert.Title>
<Alert.Description>This is a danger Alert.</Alert.Description>
</Alert.Content>
</Alert.Root>
<Alert.Root priority="info">
<Alert.Icon />
<Alert.Content>
<Alert.Title>Info</Alert.Title>
<Alert.DismissIconButton />
<Alert.Description>This is an info Alert.</Alert.Description>
</Alert.Content>
</Alert.Root>
<Alert.Root priority="success">
<Alert.Icon />
<Alert.Content>
<Alert.Title>Success</Alert.Title>
<Alert.Description>This is a success Alert.</Alert.Description>
</Alert.Content>
</Alert.Root>
<Alert.Root priority="warning">
<Alert.Icon />
<Alert.Content>
<Alert.Title>Warning</Alert.Title>
<Alert.Description>This is a warning Alert.</Alert.Description>
</Alert.Content>
</Alert.Root>
<Alert.Root priority="danger">
<Alert.Icon svg={<ShrimpIcon />} />
<Alert.Content>
<Alert.Title>Danger w/ custom icon</Alert.Title>
<Alert.Description>This is a danger Alert.</Alert.Description>
</Alert.Content>
</Alert.Root>You can mix and match what you put inside the Alert component to create different types of Alert layouts.
import { Alert } from "@ngrok/mantle/alert";
// Danger Alert with icon and Dismiss Icon Button
<Alert.Root priority="danger">
<Alert.Icon />
<Alert.Content>
<Alert.Title>Danger Will Robinson</Alert.Title>
<Alert.DismissIconButton />
<Alert.Description>This is a danger alert.</Alert.Description>
</Alert.Content>
</Alert.Root>
// Danger Alert without icon
<Alert.Root priority="danger">
<Alert.Content>
<Alert.Title>Danger Will Robinson</Alert.Title>
<Alert.Description>This is a danger alert.</Alert.Description>
</Alert.Content>
</Alert.Root>
// Danger Alert with icon and no description
<Alert.Root priority="danger">
<Alert.Icon />
<Alert.Content>
<Alert.Title>Danger Will Robinson</Alert.Title>
</Alert.Content>
</Alert.Root>
// Danger Alert without icon or description, but including a Dismiss Icon Button
<Alert.Root priority="danger">
<Alert.Content>
<Alert.Title>Danger Will Robinson</Alert.Title>
<Alert.DismissIconButton />
</Alert.Content>
</Alert.Root>For banner-like alerts, use the appearance="banner" prop. This automatically removes the top, left, and right border, leaving only the bottom border.
Laboris commodo Lorem anim consequat ut dolore proident.
import { Alert } from "@ngrok/mantle/alert";
<Alert.Root priority="info" appearance="banner">
<Alert.Icon />
<Alert.Content>
<Alert.Title>This is an info Alert as a page banner</Alert.Title>
</Alert.Content>
</Alert.Root>;Displays a callout for user attention. Root container for all Alert sub-components.
All props from div, plus:
The container for the content slot of an Alert. Place Alert.Title, Alert.Description, and Alert.DismissIconButton as direct children.
All props from div.
The optional description of an Alert. Renders as a div by default, but can be changed to any other element using the asChild prop.
All props from div, plus:
An optional icon that visually represents the priority of the Alert. The default rendered icon can be overridden with a custom icon using the svg prop.
All props from svg, plus:
The title of an Alert. Renders as an h5 element by default; use asChild to render something else.
All props from h5, plus:
A dismiss icon button that closes the alert when clicked.
All props from button, plus: