1.0.0 • Published 10 months ago

react-blur-modals v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
10 months ago

react-blur-modals

npm version License

A collection of beautiful mobile-friendly modals built with React, Framer Motion, and Tailwind CSS. Easily create stylish and interactive modals for your mobile applications.

Installation

To install react-blur-modals, you can use npm or yarn:

npm install react-blur-modals --save

or

yarn add react-blur-modals

Usage

import { ModalContent, ModalButton } from 'react-blur-modals';
import { useState } from 'react';

export default function Test() {
  const [modalOpen, setModalOpen] = useState(false);

  const handleModalToggle = () => {
    setModalOpen(!modalOpen);
  };

  return (
    <>
      <ModalButton text="Open Modal" backgroundColor="blue-600" onClick={handleModalToggle} />
      <ModalContent isOpen={modalOpen} onClose={handleModalToggle} closeButtonColor="blue-600" animationType="easeInOut" blurPx="10px">
        <h1>React Blur Modals</h1>
      </ModalContent>

      {/** 
      *     animationType parameter supports framer-motion animation types
      */}
    </>
  );
}

Props

ModalButton

PropTypeDefaultDescription
textstringThe text to display on the button
backgroundColorstringThe background color of the button
onClickfunctionThe function to be called on button click

ModalContent

PropTypeDefaultDescription
isOpenbooleanControls whether the modal is open or closed
onClosefunctionThe function to be called when the modal is closed
closeButtonColorstringThe color of the close button
animationTypestringeaseInOutThe animation type for opening and closing the modal
blurPxstring"10px"The amount of blur to apply to the modal background

License

This project is licensed under the MIT License - see the LICENSE file for details.