Skip to main content
Alert
@coinbase/cds-web@8.34.1
A dialog that communicates critical information and blocks user interaction.
Import
import { Alert } from '@coinbase/cds-web/overlays/Alert'
SourceView source codeStorybookView StorybookFigmaView Figma (internal only)
Related components
View as Markdown
Accessibility tip (Web only)

Alerts require an accessibility label, which we set to title by default. However, if there's other text that gives the user better context to the alert, then you can pass an element id to accessibilityLabelledBy. Alternatively, you may directly provide a contextual label to accessibilityLabel.

Default Alert

Controlled using visible and onRequestClose.

Loading...

Portal Alert

Controlled programmatically using the useAlert hook.

Warning

Deprecated: Inserting JSX into the DOM using a function in an event handler is an anti-pattern. This hook will be removed in future version. Use the visible and onRequestClose props instead

Loading...

Alert over Modal

Alert displays on top of a Modal. You must pass stacked as a prop to Alert when it is used inside of a Modal.

Loading...

Is this page useful?

Coinbase Design is an open-source, adaptable system of guidelines, components, and tools that aid the best practices of user interface design for crypto products.