Formplayer Development
Complete guide for developing the Formplayer form rendering component.
Overview
Formplayer is a React web application that renders JSON Forms. It runs within WebViews in the Formulus mobile app.
Prerequisites
- Node.js 18+ and npm
- React development experience
Local Development
Setup
cd formulus-formplayer
npm install
Development Server
npm start
Opens at http://localhost:3000
Development Features
- Hot Reload: Changes reflect immediately
- Source Maps: Debug in browser DevTools
- Error Overlay: Errors shown in browser
Building
Build for React Native
Build and copy to Formulus app:
npm run build:rn
This:
- Builds the React app
- Copies build to Formulus app directory
- Updates WebView assets
Build for Web
Standard web build:
npm run build
Output in build/ directory.
Project Structure
src/: React source codepublic/: Static assetsbuild/: Production build output
Adding Question Types
-
Create Renderer Component:
// src/NewQuestionRenderer.tsx export function NewQuestionRenderer(props) { return <input {...props} /> } -
Register in Formplayer: Add to Formplayer configuration when initialized by Formulus.
Testing
npm test
Related Documentation
- Formplayer Reference - Component reference
- Form Design Guide - Creating forms