Skip to main content
Brand and assets
Build
Monitor and contribute
/
Component library
  • All components
  • Buttons & actions
  • Forms & inputs
  • Layout & containers
  • Overlays
  • Feedback & status
    • AlertNext
    • BadgeDot
    • EmptyPlaceholder
    • Loader
    • Toast
  • Data display
  • Typography
  • Accessibility
  • Contrib
  • Deprecated
  • Feedback & status
  • AlertNext

AlertNext

Shows an important message in place, without interrupting what the member is doing. Pick the variant by meaning: `negative` for urgent, `warning` for caution.

Health
Component health
Source
View on Github
Storybook
View in Storybook
Playground
View in Playground
Accessibility

partially-compliant

Platform
Universal
Accessibility issues
The dismiss control is a focusable element with no button role, no accessible name and no keyboard activation.
  • Overview
  • Props
Loading...

Successor of Alert.

Variants​

Use the variant based on semantic meaning:

  • negative for urgent alerts
  • warning for alerts of lesser importance
  • success for confirmation alerts
  • informative for information or new announcements

Only informative and success alerts can be dismissed: passing onClose displays the close button. negative and warning alerts must stay visible, so onClose is not available on them.

A new feature is available

Check it out!

All good

Your changes were saved.

Be careful

This needs your attention.

Something went wrong

Explain the error simply and how to fix it.

Actions​

Actions are declarative: pass a list of actions instead of rendering buttons as children. Set progress on an action to show a spinner and disable its button while it runs.

With the default orientation="vertical", they are stacked below the content.

Title

Actions are aligned with the title and the description

With orientation="horizontal", they are inline next to the content.

Title

Short, single-line description

Icon action​

For a more compact call to action, use iconAction. It's only available with orientation="horizontal", and its label is used as the accessible name of the button.

Title

A compact icon action, inline next to the content

Custom icons​

Each variant comes with its own icon. You can override it with icon — it natively works with <Emoji /> and <Icon /> — or hide it with icon={null}.

With an Emoji

With an Icon

Without any icon

Custom description component​

The description accepts a component, which is useful to add a link for example.

Custom description

Some information you may want to read more about. view more...

Migrating from Alert​

  • variant is now required, and positive is renamed success
  • the deprecated color prop is gone, use variant
  • children is no longer supported: action buttons move to actions, any other content to description (it accepts a ReactNode)
  • onClose is only accepted on informative and success

Accessibility​

Screen readers announce the content when the component appears dynamically: warning and negative use the assertive alert role (WAI-ARIA Alert), informative and success the polite status role.

Playground​

Loading...
tip
This component is universal, its usage is the same in murray and murray/mobile.

AlertNext props

NameTypeDefault ValueDescriptionUsage count
actionsAlertNextAction[]undefinedLabeled action buttons. Stacked when `orientation="vertical"`, inline when `"horizontal"`.
descriptionReactNode
icon
6 possibilitiesundefinednullReactElement<{ size?: IconSizeundefined; variant?: IconVariantundefined; }, stringJSXElementConstructor<any>>
iconActionAlertNextIconActionundefined
onClose(() => void)undefined
orientation"vertical""horizontal"undefinedvertical
sxPositionPropsundefined
titleReactNode
variant*"warning""negative""informative""success"

Undocumented props

NameTypeDefault ValueDescriptionUsage count
data-testidany

Style API​

Use sx for one-off adjustments. It accepts these style keys:

alignSelfanimationaspectRatiobottomcursordisplayendflexflexBasisflexGrowflexShrinkheightinsetinsetInlineinsetInlineEndinsetInlineStartleftmarginmarginBottommarginHorizontalmarginInlinemarginInlineEndmarginInlineStartmarginLeftmarginRightmarginTopmarginVerticalmatrixmaxHeightmaxWidthminHeightminWidthopacityperspectivepositionrightrotaterotateXrotateYrotateZscalescaleXscaleYskewXskewYstarttoptransformtransformOriginwidthxyzIndex

Each can be overridden per breakpoint with:

$lg$ltLg$ltMd$ltSm$ltVs$ltXl$ltXxl$md$sm$vs$xl$xs$xxl
Edit this page
Previous
Tooltip
Next
BadgeDot
  • Variants
  • Actions
    • Icon action
  • Custom icons
  • Custom description component
  • Migrating from Alert
  • Accessibility
  • Playground