useNotification
A custom hook to handle toast like adding/removing of Alert and Snackbar.
🚧 Under construction
This component is under active development. If you need this component for your project, create an issue in the GitHub repo.
Features
An Arc XP hook that handles adding and removing of alerts.
#Import
import { useNotification, AlertAction } from '@wpmedia/ads-notification'
#AlertAction
AlertAction
s are a small extension to the Button
component for use in the actions
array of an Alert
or a Snackbar
. By default, clicking on an AlertAction
closes the parent Alert
or Snackbar
.
Alert
s take either one or two AlertAction
s, while Snackbar
s take either zero or one.
An AlertAction
supports all the same props as a Button
, with the addition of preventClose
, used to indicate that the parent Alert
or Snackbar
should not close when the action is taken. See above examples.