Usage
import { Alert } from "lambda-ui-components";
export default function App() {
return (
<Alert
color="success"
variant="soft"
title="Success!"
message="Your changes have been saved successfully."
/>
);
}Alert component displays important messages to users in a prominent way.
Experiment with all the properties of the Alert component in real time.
The content of the alert message.
The title of the alert.
Controls the color scheme of the alert.
Defines the visual style of the alert.
Controls the size of the alert.
Defines the border radius of the alert.
If true, displays an icon based on the color.
This is an alert message
import { Alert } from "lambda-ui-components";
export default function App() {
return (
<Alert
color="success"
variant="soft"
title="Success!"
message="Your changes have been saved successfully."
/>
);
}You can use a custom SVG icon with the customIcon prop.
Note: Custom icons only work with the neutral color variant, as other colors use predefined semantic icons.
Check out our latest update.
When you provide an onClose callback, a close button will automatically appear on the alert. This allows users to dismiss the alert.
This action cannot be undone.
Prop | Default | Type |
|---|---|---|
color | "neutral" | "neutral" | "primary" | "secondary" | "success" | "danger" | "warning" | "info" |
message | undefined | string |
title | undefined | string |
variant | "soft" | "outline" | "soft" | "solid" |
size | "medium" | "tiny" | "small" | "medium" | "large" |
radius | "small" | "none" | "tiny" | "small" | "medium" | "large" |
showIcon | true | boolean |
customIcon | undefined | ReactNode |
onClose | undefined | () => void |
role | "status" | "alert" | "status" |