This repository contains a simple example of how to create a React modal using Tailwind CSS for styling and without relying on any UI component library.
To get started with this example, follow these steps:
-
Clone the Repository: Clone this repository to your local machine.
-
Install Dependencies: In the project directory, run
pnpm install
oryarn install
to install the necessary dependencies, including Tailwind CSScheck their official website for detailed installation
. -
Run the Application: Once the dependencies are installed, you can run the application using
pnpm dev start
oryarn dev start
. This will start the development server and open the application in your default web browser.
The modal component is implemented in the Modal.tsx
file. It uses React state to control the visibility of the modal and Tailwind CSS for styling.
The App.tsx
file contains an example of how to use the modal component and manage its behavior. It demonstrates how to control the opening and closing of the modal by handling click events and managing the modal state.