1.2.0 • Published 2 years ago

reactlightmodal-by-damevin v1.2.0

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

Logo

ReactLightModal is a modal library, built in typescript light and accessible. It's goal is to provide easy, flexible, configurable and accessible way to display modals for your application.

Documentation

See our Storybook Documentation

Authors

Demo

demo gif

Installation

Install ReactLightModal with npm

npm i reactlightmodal-by-damevin

Install ReactLightModal with yarn

yarn add reactlightmodal-by-damevin

Usage/Examples

import Modal from 'reactlightmodal-by-damevin';
import React, {useState} from "react;

const [modal, setModal] = useState(false);

const toggleModal = () => {
    setModal(!modal)
}

function App() {
  return (
      <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""

Running Tests

To run tests, run the following command

  npm run test

Contributing

Contributions are always welcome!

See contributing.md for ways to get started.

Please adhere to this project's code of conduct.