Skip to content

shoaeeb/form-craft

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

15 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

FormCraft - Professional Form Builder

A powerful, modern form builder built with React 18 and TypeScript. Create professional forms with drag-and-drop functionality and export them as JSON schemas or React components.

🌐 Live Demo: https://form-craft.onrender.com

✨ Features

🎯 Core Functionality

  • Drag & Drop Interface - Intuitive field placement with @dnd-kit
  • Live Preview - See your form in action as you build it
  • Export Options - JSON Schema or React TypeScript components
  • Form Templates - Pre-built forms (Contact, Registration, Survey, Order)

πŸ”§ Advanced Features

  • Multi-Step Forms - Break long forms into manageable steps
  • Conditional Fields - Show/hide fields based on other field values
  • Advanced Validation - Custom regex patterns, min/max lengths, custom error messages
  • Dark/Light Theme - Toggle between themes with system preference detection

πŸ“ Field Types

  • Text, Email, Password, Number, Tel, URL
  • Textarea, Select, Radio buttons, Checkboxes
  • Date, Time, DateTime, File upload

🎨 Modern UI

  • Built with Tailwind CSS and shadcn/ui components
  • Responsive design for all devices
  • Professional, clean interface

πŸš€ Tech Stack

  • React 18 - Latest React with concurrent features
  • TypeScript - Full type safety throughout
  • Vite - Fast build tool and dev server
  • Zustand - Lightweight state management
  • @dnd-kit - Modern drag and drop library
  • Tailwind CSS - Utility-first CSS framework
  • shadcn/ui - High-quality React components
  • React Hook Form - Performant forms with validation
  • Zod - TypeScript-first schema validation

πŸ› οΈ Installation

  1. Clone the repository
git clone https://github.com/yourusername/form-craft.git
cd form-craft
  1. Install dependencies
npm install
  1. Start development server
npm run dev
  1. Open your browser Navigate to http://localhost:5173

πŸ“– Usage Guide

Building Forms

  1. Add Fields - Drag field types from the left palette to the form canvas
  2. Configure Fields - Click any field to edit its properties in the right panel
  3. Reorder Fields - Drag fields within the canvas to reorder them
  4. Delete Fields - Click the trash icon to remove unwanted fields

Form Templates

  • Choose from pre-built templates: Contact, Registration, Survey, Order
  • Click any template to instantly load it
  • Customize the loaded template as needed

Multi-Step Forms

  1. Enable Multi-Step - Toggle the switch in the Multi-Step panel
  2. Add Steps - Click the "+" button to create additional steps
  3. Navigate Steps - Click step boxes or use arrow buttons
  4. Build Each Step - Add fields to the current active step

Conditional Fields

  1. Select a Field - Click on any field to edit it
  2. Set Dependency - Choose which field this field depends on
  3. Set Condition - Choose equals, not equals, contains, or not empty
  4. Set Value - Enter the condition value

Advanced Validation

  • Min/Max Length - Set character limits for text fields
  • Regex Patterns - Custom validation patterns (e.g., ^[A-Za-z]+$)
  • Custom Error Messages - Personalized validation messages

Exporting

  • JSON Schema - For backend integration and API processing
  • React Component - Ready-to-use TypeScript React component with validation

πŸ—οΈ Project Structure

src/
β”œβ”€β”€ components/          # React components
β”‚   β”œβ”€β”€ ui/             # Reusable UI components (shadcn/ui)
β”‚   β”œβ”€β”€ FieldPalette.tsx    # Draggable field types
β”‚   β”œβ”€β”€ FormCanvas.tsx      # Main form building area
β”‚   β”œβ”€β”€ SortableField.tsx   # Individual form fields
β”‚   β”œβ”€β”€ FieldEditor.tsx     # Field property editor
β”‚   β”œβ”€β”€ FormPreview.tsx     # Live form preview
β”‚   β”œβ”€β”€ FormTemplates.tsx   # Pre-built form templates
β”‚   β”œβ”€β”€ MultiStepControls.tsx # Multi-step form controls
β”‚   β”œβ”€β”€ ExportPanel.tsx     # Export functionality
β”‚   └── ThemeToggle.tsx     # Dark/light theme toggle
β”œβ”€β”€ store/              # Zustand store
β”‚   └── formStore.ts    # Main form state management
β”œβ”€β”€ types/              # TypeScript type definitions
β”‚   └── index.ts        # Form and field type definitions
β”œβ”€β”€ lib/                # Utility functions
β”‚   └── utils.ts        # Helper functions
β”œβ”€β”€ utils/              # Additional utilities
β”‚   └── keepAlive.ts    # Keep-alive functionality
└── App.tsx             # Main application component

🎨 Customization

Themes

  • Toggle between light and dark themes
  • System preference detection
  • Persistent theme selection

Styling

  • Modify Tailwind CSS classes
  • Customize component styles in src/components/ui/
  • Update global styles in src/globals.css

πŸ“¦ Build & Deploy

Build for Production

npm run build

Deploy to Render

  1. Connect your GitHub repository to Render
  2. Set build command: npm run build
  3. Set publish directory: dist
  4. Deploy as a Static Site

πŸ” SEO Features

  • Comprehensive meta tags for search engines
  • Open Graph tags for social media sharing
  • Twitter Card support
  • Structured data (JSON-LD)
  • Sitemap and robots.txt
  • Google Analytics integration

🀝 Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

πŸ™ Acknowledgments

πŸ“ž Support

If you have any questions or need help, please:


Built with ❀️ using React, TypeScript, and modern web technologies.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors