react-tailwind-forms
v1.0.8
Published
Beautiful React login and signup forms built with TailwindCSS
Maintainers
Readme
React Tailwind Forms Package
A simple and customizable React package that provides Login and Signup forms.
The forms accept a backendUrl prop to send login and signup requests to your backend API.
📚 Table of Contents
- 🚀 Installation
- 📦 Usage
- 🔧 Props
- 💡 Features
- 🛠️ Development Setup
- 📝 Example API Endpoints
- 🕋️ License
- 🤝 Contributing
- 🔗 Links
🚀 Installation
To install the package in your React project, run the following command:
npm install react-tailwind-forms📦 Usage
1. Import the components
Import the Login and Signup components into your React project:
import { Login, Signup } from "react-tailwind-forms";2. Usage Example
You can use the Login and Signup components like this:
import React from "react";
import { Login, Signup } from "react-tailwind-forms";
const App = () => {
return (
<div>
<h1>Welcome to Your App</h1>
{/* Pass backend URL as a prop */}
<Login backendUrl="http://localhost:5000" />
{/* Or use the Signup form */}
<Signup backendUrl="http://localhost:5000" />
</div>
);
};
export default App;Replace
"http://localhost:5000"with your actual backend API URL.
🔧 Props
| Prop | Type | Required | Description | |-------------|--------|----------|-------------------------------------------------| | backendUrl | String | Yes | The URL of your backend API for login/signup. |
💡 Features
- Login Form: Sends a POST request with
emailandpassword. - Signup Form: Sends a POST request with
name,email, andpassword. - TailwindCSS Styling: Pre-styled, but customizable forms.
- Easy Integration: Just pass your backend URL as a prop.
🛠️ Development Setup
If you want to contribute or make changes to this package:
1. Clone the repository
git clone https://github.com/anilgummula/react-tailwind-forms.git
cd react-tailwind-forms2. Install dependencies
npm install3. Run the development environment
npm run dev📝 Example API Endpoints
Your backend should be ready to handle these:
- Login:
POST /login- Request Body:
{ email, password } - Response:
{ token, user }
- Request Body:
- Signup:
POST /signup- Request Body:
{ name, email, password } - Response:
{ user }
- Request Body:
🕋️ License
This project is licensed under the MIT License - see the LICENSE file for details.
🤝 Contributing
We welcome contributions!
Feel free to open issues and submit pull requests for improvements.
