Skip to main content

Common Examples

import { Announcement } from "@servicetitan/anvil2";

function ExampleComponent() {
  return (
    <Announcement
      status="info"
      title="We have an announcement for you. Hopefully you find it informational."
    />
  );
}

Announcement Status

Use the status prop to update the colors and icon of the Announcement.

Action Buttons

Pass in a Button as the children of the Announcement to add an action. Multiple actions are allowed, but discouraged.

Closing Announcements

Add the onClose callback prop to the Announcement to include a close button.
Last modified on January 23, 2026