Alert
Last updated: 2.0.0 (19/01/2024)
Usage
Controlled alert content
Actions on click
Other button attributes and behaviors can be passed to the Alert as well.
Alert levels
The variant
prop can be used to display the alert with different appearances. These variants can be used to create awareness and urgency in the alert, which may be useful when displaying errors, etc.
"filled"
makes the alert very visible, which is useful for displaying major errors. E.g. input validation error, save failure, etc."light"
draws attention to the alert, but with a softness that is more suitable for positive updates or minor errors. E.g. successful save, non-breaking error, etc."subtle"
is the least attention-grabbing of the three, and is best used for very minor alerts. E.g. additional information about an action, ideal input content, etc.
Props
Extends GenericClickableProps
, GenericClickableEventProps
, PolymorphicButtonProps
and GenericLayoutProps
.
alert (required)
AlertContent
The content of this alert.
show
boolean
Whether to mount and show this alert.
variant
FillVariant
The styling variant of this alert. Defaults to filled
.
size
ComponentSize
The size of this alert. Defaults to the theme default size.
radius
ComponentSize
The border size of this alert. Defaults to the theme default radius size.
shadow
boolean
Specifies if a shadow will be shown.
motion
MotionBehaviourProps
Defines motion behavior for this button. This will automatically be overridden if the user has reduced motion enabled on their device.
AlertContent
title (required)
string
The title of this alert.
message
string
The message of this alert.
icon
ReactNode
The icon of this alert.
Last updated
Was this helpful?