A full-featured React application for creating dynamic forms using SurveyJS's professional drag-and-drop form builder.
- Professional Drag-and-Drop Interface - SurveyJS Creator with intuitive UI
- Rich Component Library - 25+ form elements (Text, Dropdown, Checkboxes, Radio, Rating, File Upload, Signature, etc.)
- Visual Designer - Build forms visually with toolbox, canvas, and properties panel
- Properties Panel - Configure each element's settings, validation, and logic
- Conditional Logic - Show/hide fields based on answers
- Multi-page Forms - Create wizard-style forms
- Preview Mode - Test forms before saving
- JSON Editor - View and edit form schema directly
- Create Forms - Build and save forms with drag-and-drop
- Edit Forms - Load and modify existing forms
- Render Forms - Dynamically display forms to users
- Collect Submissions - Store form responses
- View Submissions - Review all submitted data
- localStorage Storage - No backend required for demo
- React 19 with TypeScript
- SurveyJS - Professional form builder and renderer
survey-creator-react- Form builder componentsurvey-react-ui- Form renderersurvey-core- Core functionality
- React Router DOM - Client-side routing
- Axios - HTTP client
- Express - REST API server
- MongoDB with Mongoose - Database
- CORS - Cross-origin support
# Clone the repository
git clone https://github.com/react-angular-standards/form-builder-example.git
cd form-builder-example
# Install dependencies
npm install --legacy-peer-depsnpm startThe app will open at http://localhost:3000
# Terminal 1 - Start MongoDB
mongod
# Terminal 2 - Start Backend
npm run server
# Terminal 3 - Start Frontend
npm start- Navigate to http://localhost:3000
- Click "Create New Form"
- Enter form name and description
- Use the SurveyJS Creator interface:
- Toolbox (Left) - Drag components to the canvas
- Canvas (Center) - Design your form
- Properties (Right) - Configure selected elements
- Click "Save Form"
- From the forms list, click the edit icon (βοΈ)
- Modify the form in the builder
- Click "Update Form"
- From the forms list, click the view icon (ποΈ)
- Fill in the form fields
- Click "Complete" to submit
- From the forms list, click the submissions icon (π)
- View all form responses with timestamps
dynamic-form-react/
βββ public/ # Static files
βββ server/ # Backend (optional)
β βββ models/
β β βββ Form.js # Form schema
β β βββ FormSubmission.js
β βββ routes/
β β βββ forms.js # API endpoints
β βββ server.js # Express server
βββ src/
β βββ components/
β β βββ FormBuilder.tsx # SurveyJS Creator wrapper
β β βββ FormRenderer.tsx # SurveyJS form renderer
β β βββ FormBuilder.css
β β βββ FormRenderer.css
β βββ pages/
β β βββ FormList.tsx # List all forms
β β βββ FormBuilderPage.tsx
β β βββ FormSubmissions.tsx
β β βββ *.css
β βββ services/
β β βββ api.ts # API client (localStorage)
β βββ App.tsx
β βββ index.tsx
βββ .env
βββ package.json
βββ README.md
GET /api/forms- Get all formsGET /api/forms/:id- Get specific formPOST /api/forms- Create new formPUT /api/forms/:id- Update formDELETE /api/forms/:id- Delete formPOST /api/forms/:id/submit- Submit form responseGET /api/forms/:id/submissions- Get form submissions
Create a .env file:
# Backend
MONGODB_URI=mongodb://localhost:27017/dynamic-forms
PORT=5001
# Frontend
REACT_APP_API_URL=http://localhost:5001/apiSurveyJS provides 25+ components including:
Input Fields:
- Single Input (Text)
- Multi-line Input (Comment)
- Number
- URL
- Password
Choice Fields:
- Dropdown
- Radio Group
- Checkboxes
- Tag Box
- Boolean (Yes/No)
Advanced:
- Rating
- Ranking
- Image Picker
- File Upload
- Signature Pad
- Date/Time
- Matrix (Grid)
- Dynamic Panel
Layout:
- Panel
- HTML
- Image
- Expression
- Drag components from toolbox to canvas
- Click any element to configure its properties
- Set validation rules, default values, placeholders
- Add conditional logic (show/hide based on answers)
- Organize with panels and pages
- Preview form before saving
- Required fields
- Min/max length
- Min/max value
- Email format
- URL format
- Regex patterns
- Custom validation expressions
- Show/hide questions based on answers
- Enable/disable fields
- Make fields required conditionally
- Set values based on other fields
- Create wizard-style forms
- Progress indicator
- Navigation between pages
- Page visibility conditions
npm start # Start React development server
npm run build # Build for production
npm run server # Start backend server
npm run dev # Run both frontend and backend
npm test # Run tests- Chrome (latest)
- Firefox (latest)
- Safari (latest)
- Edge (latest)
- Some TypeScript warnings from library types (doesn't affect functionality)
- Source map warnings from SurveyJS (can be ignored)
- User authentication
- Form templates
- Export submissions to CSV/Excel
- Email notifications
- Form analytics
- Custom themes
- Form versioning
- Duplicate form functionality
- Public/private form sharing
MIT
Built with:
- SurveyJS - Professional form builder
- React - UI library
- Express - Backend framework
- MongoDB - Database
Feel free to submit issues and enhancement requests!