mirror of
https://gitlab.nic.cz/turris/reforis/foris-js.git
synced 2025-04-21 08:16:39 +02:00
22 lines
484 B
Markdown
22 lines
484 B
Markdown
Bootstrap alert component.
|
|
|
|
```jsx
|
|
import { useState } from "react";
|
|
|
|
function AlertExample() {
|
|
const [alert, setAlert] = useState(true);
|
|
if (alert)
|
|
return (
|
|
<Alert type="warning" onDismiss={() => setAlert(false)}>
|
|
Some warning out there!
|
|
</Alert>
|
|
);
|
|
return (
|
|
<button className="btn btn-secondary" onClick={() => setAlert(true)}>
|
|
Show alert again
|
|
</button>
|
|
);
|
|
}
|
|
<AlertExample />;
|
|
```
|