@axa-fr/react-toolkit-modal-default v3.0.1
@axa-fr/react-toolkit-modal-default
Installation
npm i @axa-fr/react-toolkit-modal-default
npm i @axa-fr/react-toolkit-button
Custom Header Story
Import
import Modal from '@axa-fr/react-toolkit-modal-default';
import '@axa-fr/react-toolkit-modal-default/dist/af-modal.css';
import '@axa-fr/react-toolkit-button/dist/af-button.css';
Use
import { useRef } from 'react';
export const YourComponent = () => {
const ref = useRef < HTMLDialogElement > null;
return (
<>
<button type="button" onClick={() => ref.current?.showModal()}>
Ouvrir la modal
</button>
<Modal onOutsideTap={() => ref.current?.close()} ref={ref}>
<HeaderBase id="headerId">
<p>
Ici je contrôle complètement
<b>le contenu</b>
</p>
</HeaderBase>
<Body>
<p>
Reprehenderit sit quis aute nisi consequat consequat mollit. Commodo
in aliquip consectetur nulla sit anim. Pariatur minim commodo enim
ea eu laborum culpa laboris. Labore labore irure ipsum consequat
enim officia anim ipsum aliqua excepteur qui sint. Duis sint do
culpa adipisicing dolor adipisicing ea dolore aute nisi quis ullamco
aliquip occaecat. Aute ut mollit amet.
</p>
</Body>
<Footer>
<button
className="btn af-btn af-btn--reverse"
type="button"
onClick={() => ref.current?.close()}>
Annuler
</button>
<button className="btn af-btn" type="button">
Valider
</button>
</Footer>
</Modal>
</>
);
};
1 month ago
1 month ago
2 months ago
2 months ago
3 months ago
7 months ago
7 months ago
8 months ago
8 months ago
10 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
12 months ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago