Skip to main content

AlertDismissable

The AlertDismissable component is a simple React component that displays a dismissable alert message. It is built using Bootstrap CSS classes for styling.

Usage

import AlertDismissable from '@site/src/components/AlertDismissable';

<AlertDismissable
show={true}
title="Alert Title"
>
This is an alert message.
</AlertDismissable>

Props

PropTypeDescription
showbooleanControls the visibility of the alert.
titlestringThe title of the alert message.
childrenReact.ReactNodeThe content to be displayed within the alert.

Example

This is how the AlertDismissable component would be used in a React application.

import React, { useState } from 'react';
import AlertDismissable from '@site/src/components/AlertDismissable';

function Example() {
const [showAlert, setShowAlert] = useState(false);

return (
<div>
<button onClick={() => setShowAlert(true)}>Show Alert</button>
<AlertDismissable
show={showAlert}
title="Important Alert"
>
This is an important message that the user should see.
</AlertDismissable>
</div>
);
}