0.3.2 • Published 2 years ago

modal-by-yflly v0.3.2

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

forthebadge forthebadge forthebadge

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

NameTypeRequiredDescriptionDefault value
canClosebooleanfalseDisplay cross button on the top-right of the modal boxtrue
closeBtnContentJSX.elementfalseCustom content add on the close button (exemple: personalized icon, ...){<span>X</span}
footerContentJSX.elementfalseCustom content to add to the footer (exemple: action buttons, ...){}
haveFooterbooleanfalseIf his value is true, the modal have footer elementfalse
isOpenbooleantrueIf his value is true, the modal is displayedfalse
modalContentJSX.elementtrueContent of the modal{}
titlestringfalseModal header title""