react-popup-package

1.0.2 • Public • Published

React Popup With Tailwind

This is an library to create a popup with Tailwind easily.

Example Usage

  • First, you must install the library using npm
  • Install TailwindCSS using npm install tailwindcss
  • After that you can use like;
import React, { useState } from 'react';
import Popup from 'react-popup-package';

const App = () => {
  const [isOpen, setIsOpen] = useState(false);

  return (
    <div>
      <button 
        onClick={() => setIsOpen(true)} 
        className="bg-blue-500 text-white py-2 px-4 rounded"
      >
        Open Popup
      </button>

      {isOpen && (
        <Popup 
          title="Example Popup"
          content="This is an example popup using React and TailwindCSS!"
          isDarkMode={false}
          style="shadow"
          onClose={() => setIsOpen(false)}
        />
      )}
    </div>
  );
};

export default App;

/react-popup-package/

    Package Sidebar

    Install

    npm i react-popup-package

    Weekly Downloads

    5

    Version

    1.0.2

    License

    MIT

    Unpacked Size

    7.78 kB

    Total Files

    3

    Last publish

    Collaborators

    • emrdd