0.3.2 • Published 2 years ago
modal-by-yflly v0.3.2
simple-component-library
A library of React components created using create-react-app
.
modal-by-yflly is a modal library, Flexible, configurable and accessible way to display modals for your application.
Authors
Installation
Install modal-by-yflly with npm
npm i modal-by-yflly
Install ReactLightModal with yarn
yarn add modal-by-yflly
Usage/Examples
import Modal from "modal-by-yflly";
import React, { useState } from "react";
const [modal, setModal] = useState(false);
const toggleModal = () => {
setModal(!modal);
};
function App() {
return <Modal isOpen={modal} />;
}
Props
Name | Type | Required | Description | Default value |
---|---|---|---|---|
canClose | boolean | false | Display cross button on the top-right of the modal box | true |
closeBtnContent | JSX.element | false | Custom content add on the close button (exemple: personalized icon, ...) | {<span>X</span} |
footerContent | JSX.element | false | Custom content to add to the footer (exemple: action buttons, ...) | {} |
haveFooter | boolean | false | If his value is true, the modal have footer element | false |
isOpen | boolean | true | If his value is true, the modal is displayed | false |
modalContent | JSX.element | true | Content of the modal | {} |
title | string | false | Modal header title | "" |