Alert API
import { Alert } from '@editora/ui-react';
Props
| Prop | Type | Description |
|---|---|---|
children | React.ReactNode | |
description | string | |
dismissible | boolean | |
elevation | 'none' | 'low' | 'high' | |
headless | boolean | |
indicator | 'line' | 'none' | |
layout | 'inline' | 'banner' | |
live | boolean | false for a static page banner: no role=alert/status and no aria-live, so it is not announced when the page loads. Keep the default (true) for messages that appear in response to something. |
onClose | () => void | |
open | boolean | |
radius | number | string | |
size | 'sm' | 'md' | 'lg' | '1' | '2' | '3' | |
title | string | |
tone | 'neutral' | 'info' | 'success' | 'warning' | 'danger' | |
variant | 'surface' | 'soft' | 'outline' | 'solid' |
Also accepts the standard HTML and React props of the element it renders (className, style, id, aria-*, data-*, event handlers).
Alert.Icon props
| Prop | Type | Description |
|---|---|---|
as | keyof JSX.IntrinsicElements | |
children | React.ReactNode |
Also accepts the standard HTML and React props of the element it renders (className, style, id, aria-*, data-*, event handlers).
Alert.Title props
| Prop | Type | Description |
|---|---|---|
as | keyof JSX.IntrinsicElements | |
children | React.ReactNode |
Also accepts the standard HTML and React props of the element it renders (className, style, id, aria-*, data-*, event handlers).
Alert.Description props
| Prop | Type | Description |
|---|---|---|
as | keyof JSX.IntrinsicElements | |
children | React.ReactNode |
Also accepts the standard HTML and React props of the element it renders (className, style, id, aria-*, data-*, event handlers).
Alert.Actions props
| Prop | Type | Description |
|---|---|---|
as | keyof JSX.IntrinsicElements | |
children | React.ReactNode |
Also accepts the standard HTML and React props of the element it renders (className, style, id, aria-*, data-*, event handlers).
Element: <ui-alert>
Alert renders the ui-alert custom element from @editora/ui-core, which can also be used without React.
Attributes: description, dismissible, elevation, headless, hidden, indicator, layout, live, radius, size, title, tone, variant
Events: close