This is the alert title
import { Alert } from "@/components/alert";
function Example() {
return <Alert title="This is the alert title" />;
}
Examples
Description
Use the description prop to provide additional context to the alert:
Invalid Fields
Your form has some errors. Please fix them and try again.
import { Alert } from "@/components/alert";
function Example() {
return (
<Alert
status="error"
showIndicator
title="Invalid Fields"
description="Your form has some errors. Please fix them and try again."
/>
);
}
Status
Use the status prop to change the appearance of the alert:
Information
This is an informational alert.
Warning
This is a warning alert.
Success
This is a success alert.
Error
This is an error alert.
import { Alert } from "@/components/alert";
function Example() {
return (
<div className="flex flex-col gap-2">
<Alert
status="info"
showIndicator
title="Information"
description="This is an informational alert."
/>
<Alert
status="warning"
showIndicator
title="Warning"
description="This is a warning alert."
/>
<Alert
status="success"
showIndicator
title="Success"
description="This is a success alert."
/>
<Alert
status="error"
showIndicator
title="Error"
description="This is an error alert."
/>
</div>
);
}