An open API service indexing awesome lists of open source software.

https://github.com/nafistarik/pxlhut_form

A responsive multi-step form with validation using React Hook Form and Zod. Built with Next.js, Redux Toolkit, and TailwindCSS. Includes dark mode, animations, and state persistence.
https://github.com/nafistarik/pxlhut_form

multi-step-form next reducer rtk-query

Last synced: 2 months ago
JSON representation

A responsive multi-step form with validation using React Hook Form and Zod. Built with Next.js, Redux Toolkit, and TailwindCSS. Includes dark mode, animations, and state persistence.

Awesome Lists containing this project

README

          

# ๐Ÿš€ Multi-Step Form with Validation (Next.js + React Hook Form + Zod)
A fully responsive and animated multi-step form built with **Next.js (App Router)**, **React Hook Form**, **Zod**, **Redux Toolkit**, and **TailwindCSS**. This project demonstrates best practices in form handling, validation, state management, and user experience with dark/light mode and animations.

## ๐Ÿงฐ Tech Stack
- [Next.js 14 (App Router)](https://nextjs.org/docs/app)
- [React Hook Form](https://react-hook-form.com/)
- [Zod](https://zod.dev/) for schema-based validation
- [Redux Toolkit](https://redux-toolkit.js.org/)
- [redux-persist](https://github.com/rt2zz/redux-persist)
- [Tailwind CSS](https://tailwindcss.com/)
- [Framer Motion](https://www.framer.com/motion/) for animations
- [RTK Query](https://redux-toolkit.js.org/rtk-query/overview) for API simulation
- [Sonner](https://sonner.emilkowal.ski/) for toast notifications

## ๐Ÿ“ Features
### ๐Ÿงพ Form Steps
1. **Personal Information**
- Full Name (required)
- Email (valid format, required)
- Phone Number (min 10 digits)
2. **Address Details**
- Street Address (required)
- City (required)
- Zip Code (numbers only, min 5 digits)
3. **Account Setup**
- Username (min 4 characters)
- Password (min 6 characters)
- Confirm Password (must match password)
4. **Summary & Submit**
- Review all entered data before final submission

### โœ… Validations
- Built with **Zod** and integrated via **React Hook Form**
- Validation per step
- Real-time error feedback under each field

### ๐ŸŒ State Management
- Global state managed with **Redux Toolkit**
- Data persisted using **redux-persist**
- Simulated submission via **RTK Query**

### ๐Ÿ’ก UI/UX
- Fully **responsive design**
- **Dark/Light mode toggle** with theme persistence
- **Progress indicators** and **step transitions**
- **Animated step transitions** with Framer Motion
- **Toast notifications** for success/error feedback

## ๐Ÿ“ฆ Getting Started
### 1. Clone the Repository
```bash
git clone https://github.com/nafistarik/PxlHut_Form
cd multi-step-form
```

### 2. Install Dependencies
```bash
npm install
# or
yarn install
```

### 3. Run the Development Server
```bash
npm run dev
# or
yarn dev
```
App should be running at http://localhost:3000

## ๐Ÿ“‚ Folder Structure
```
app/
โ”ฃ form/
โ”ƒ โ”ฃ steps/
โ”ƒ โ”ฃ components/
โ”ƒ โ”— context/
โ”ฃ store/
โ”ฃ styles/
โ”ฃ utils/
โ”— layout.tsx
```
- `steps/` โ†’ Each step of the form
- `store/` โ†’ Redux Toolkit configuration
- `utils/` โ†’ Validation schemas, helpers
- `context/` โ†’ Theme/dark mode provider

## ๐Ÿงช Bonus Features
- ๐Ÿ”„ Simulated API delay using RTK Query
- ๐ŸŒ— Dark/Light mode with TailwindCSS
- ๐Ÿ’พ Form state persists on refresh