Alert

Inline alerts with four semantic colors, an optional title, icon and close button.

Props

PropTypeDefaultDescription
variant'info' | 'success' | 'warning' | 'danger''info'Semantic color: info / success / warning / danger
titleReactNode—Title; omit it to show the message only
iconReactNode—Custom icon; falls back to a colored dot
onClose() => void—Pass a handler to render the close button
closeLabelstring'Dismiss'Accessible name of the close button, defaults to Dismiss
borderedbooleantrueWhether the border shows, defaults to true
accentbooleantrueWhether the accent coloring (icon and background) is used, defaults to true
childrenReactNode—Alert message
...restHTMLAttributes—Remaining props are forwarded to the native div