1.5.0 • Published 2 years ago

react-tailwind-modal v1.5.0

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

react-tailwind-modal

NPM version Build npm-typescript

Installation:

npm install react-tailwind-modal --save-dev

or

yarn add -D react-tailwind-modal

Usage :

Add Modal to your component:

import React, { useState } from 'react'
import ReactDOM from 'react-dom/client'
import { Modal } from 'react-tailwind-modal'
import './index.css'

const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement)

const App = () => {
  const [modal, setModal] = useState(false)
  return (
    <div>
      <h1 className='my-8 text-center text-3xl'>Modal</h1>
      <button
        onClick={() => setModal(true)}
        data-modal-toggle='modal'
        title='Close'
        className='mx-auto block text-sm bg-gray-900 text-white font-semibold py-2 px-4 border border-gray-900 rounded-md duration-200 ease-out hover:scale-105'
      >
        Open
      </button>
      <div>{modal && <Modal title='Welcome' content='Hello World' onClick={() => setModal(false)} />}</div>
    </div>
  )
}

root.render(
  <React.StrictMode>
    <App />
  </React.StrictMode>,
)
1.2.0

2 years ago

1.5.0

2 years ago

1.4.0

2 years ago

1.3.0

2 years ago

0.1.0

2 years ago

0.3.0

2 years ago

0.2.0

2 years ago

0.9.0

2 years ago

0.8.0

2 years ago

0.5.0

2 years ago

0.4.0

2 years ago

0.7.0

2 years ago

0.6.0

2 years ago

1.1.0

2 years ago

1.0.0

2 years ago