You are viewing a PR preview for PR #1506

Agriculture Design System
Beta
Design System for the Export Service

Page alert

Page alerts are colour-coded, non-disruptive notifications that provide Success, Error, Warning or Information messages at relevant times during the user journey. They should not be confused with Callouts.

View in FigmaView in StorybookView in Github
import { ... } from '@ag.ds-next/react/page-alert';

Usage

Page alert components can be imported via the page-alert entrypoint in the @ag.ds-next/react package.

For example:

import { ... } from '@ag.ds-next/react/page-alert';

Props

PageAlert Props
PropTypeDescription
tone"info" | "success" | "error" | "warning"The tone of the alert.
children?ReactNode
id?string
onDismiss?MouseEventHandler<HTMLButtonElement>Function to be called when the 'Close' button is pressed.
ref?Ref<HTMLDivElement>
role?AriaRole
tabIndex?number
title?ReactNodeThe title of the alert.
PageAlertTitle Props
PropTypeDescription
as?"h1" | "h2" | "h3" | "h4" | "h5" | "h6"Default: "h3"
children?ReactNode
hasDismissButton?boolean

Source

You can view the full source code for this package on Github.