WUI logo

Alert

The Alert component is used to provide users with important messages or feedback. It ensures that critical information is conveyed in a clear and visually distinct manner. This component can be customized to fit various contexts and uses within the application.

import * as React from 'react'
import { Alert } from '@welcome-ui/alert'
const Example = () => {
return (
<Alert>
<Alert.Title>This is an alert</Alert.Title>
<span>
Nunc laoreet egestas nulla, et dapibus sem malesuada in. Suspendisse eleifend accumsan
ultrices. Phasellus iaculis nisi sed dui ornare commodo. Nullam dapibus varius nibh a
ornare.
</span>
</Alert>
)
}
export default Example

Installation

1

Run the following command:

yarn add @welcome-ui/alert
2

Import component:

import { Alert } from '@welcome-ui/alert'

Variants

Sizes

By default the size is sm.

Only a title

We include an icon that matches the variant, but you have the option to remove it or replace it with a custom node.

With CTA

When the cta prop is used, it will be displayed in a column on the right.

Full Width

Set property isFullWidth to take the full width of the parent.

CloseButton

To show a close button you need to pass your function on the handleClose property.