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