Skip to content
This repository has been archived by the owner on Jan 31, 2024. It is now read-only.

Latest commit

 

History

History
38 lines (27 loc) · 962 Bytes

alert.md

File metadata and controls

38 lines (27 loc) · 962 Bytes

Alert

Renders a notification message.

Alert example

<div>
    <Alert type="success">Success!</Alert>
    <Alert type="info">Info!</Alert>
    <Alert type="warning">Warning!</Alert>
    <Alert type="danger">Danger!</Alert>
</div>

Props

type={string}
The type of alert to display. One of "default", "success", "info", "warning", or "danger".

icon={string}
Name of the icon to display on the left hand side of the alert. Defaults to no icon.

closeable={bool}
Whether the alert may be closed. Displays a close icon when true.

closeTitle={string}
Displayed when hovering over the close icon.

onClose={function}
Called when the alert is closed.

CSS

Adds dp-alert to the root element.

Adds dp-alert--${type} to the root element, where ${type} matches the type prop value.

Adds dp-bg--${type} to the root element, where ${type} matches the type prop value.