0.1.0 • Published 1 year ago

@remkiovo/react-modal v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@remkiovo/react-modal

A simple, lightweight, and customizable modal component for React applications with TypeScript support and TailwindCSS styling.

Installation

npm install @remkiovo/react-modal

or

yarn install @remkiovo/react-modal

Features

  • 🎯 Simple and easy to use
  • 🎨 Customizable styling with TailwindCSS
  • 📱 Responsive design
  • 🔒 TypeScript support
  • 🖱️ Click outside to close
  • ✨ Smooth animations
  • ⌨️ Accessible

Usage

import { useState } from "react";
import Modal from "@remkiovo/react-modal";
function App() {
  const [isOpen, setIsOpen] = useState(false);
  return (
    <>
      <button onClick={() => setIsOpen(true)}>Open Modal</button>
      {isOpen && (
        <Modal
          title="Welcome!"
          description="This is a simple modal component."
          buttonText="Close"
          closeModal={() => setIsOpen(false)}
          buttonOnClick={() => setIsOpen(false)}
          buttonClassName="bg-blue-500 hover:bg-blue-600 text-white"
        />
      )}
    </>
  );
}

Props

PropTypeRequiredDescription
titlestringYesThe title of the modal
descriptionstringYesThe main content/description of the modal
buttonTextstringYesText to display on the action button
closeModal() => voidYesFunction to call when closing the modal
buttonOnClick() => voidYesFunction to call when the action button is clicked
classNamestringNoAdditional classes for the modal container
buttonClassNamestringNoAdditional classes for the action button

Styling

The modal comes with default styling using TailwindCSS. You can customize the appearance by:

  1. Using the className prop to style the modal container
  2. Using the buttonClassName prop to style the action button

Requirements

  • React 18 or higher
  • TailwindCSS 3.x

License

MIT © RemKiovo

0.1.0

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago