- Implementation
- Alert Props
Common Examples
Alert statuses
Use thestatus prop to set the color and icon of the Alert.Closable alerts
Make an alert closable by providing a value to theonClose prop.Alerts are notifications that inform a user about something.
import { Alert } from "@servicetitan/anvil2";
function ExampleComponent() {
return (
<Alert status="warning" title="Warning!">
This is a warning message.
</Alert>
);
}
status prop to set the color and icon of the Alert.onClose prop.<Alert
title="Warning!"
status="warning"
onClose={(e) => console.log("Alert closed")}
>
This is a warning message.
</Alert>
Alert PropsWas this page helpful?