Form Editor
The Form Editor lets admins build custom forms for collecting data. It uses a three-panel layout: field types on the left (draggable), a live form preview in the center, and field settings on the right. This is a composite pattern. Not a single component. It combines MUI Tabs, List, TextField, Switch, and Card components wired together. It opens as a modal from inside the Workflow Editor when configuring a Form node.
Overview
The Form Editor lets admins build custom forms (registration, surveys, data collection) by selecting field types, configuring labels and validation, and previewing the result. No code.
Admin needs to create or edit a structured form within a workflow
Select field types, configure settings, reorder, preview, and save
Workflow Editor → Form node → Configure
Interactive Preview
Student Registration
Click a field to edit it, or add new fields from the left.
Field Components
Each field type in the Form Editor maps to a specific MUI component (or combination of components). Use these references when building new field types or implementing form validation. All fields use the outlined variant for consistency.
Text Input
Single-line text entry for names, titles, or short answers.
<TextField
label="Full Name"
variant="outlined"
fullWidth
required
inputProps={{ maxLength: 100 }}
/>Email input with built-in browser validation.
<TextField label="Email Address" type="email" variant="outlined" fullWidth required />
Phone
Phone number input with tel keyboard on mobile.
<TextField
label="Phone Number"
type="tel"
variant="outlined"
fullWidth
inputProps={{ pattern: "[0-9]*" }}
/>Number
Numeric input with optional min/max/step constraints.
<TextField
label="Age"
type="number"
variant="outlined"
fullWidth
inputProps={{ min: 0, max: 120 }}
/>Date
Date picker with calendar popup. Use MUI DatePicker in production.
import { DatePicker } from '@mui/x-date-pickers/DatePicker';
<DatePicker
label="Date of Birth"
slotProps={{ textField: { variant: 'outlined', fullWidth: true } }}
/>Textarea
Multi-line text entry for descriptions, comments, or long-form content.
<TextField
label="Description"
variant="outlined"
fullWidth
multiline
minRows={3}
maxRows={8}
/>Select
Dropdown for selecting one option from a list.
<FormControl fullWidth>
<InputLabel>Cohort</InputLabel>
<Select label="Cohort" value={value} onChange={handleChange}>
<MenuItem value="fall-2025">Fall 2025</MenuItem>
<MenuItem value="spring-2026">Spring 2026</MenuItem>
</Select>
</FormControl>Radio
Single selection from a small visible set of options (2–5).
<FormControl>
<FormLabel>Experience Level</FormLabel>
<RadioGroup value={value} onChange={handleChange}>
<FormControlLabel value="beginner" control={<Radio />} label="Beginner" />
<FormControlLabel value="intermediate" control={<Radio />} label="Intermediate" />
<FormControlLabel value="advanced" control={<Radio />} label="Advanced" />
</RadioGroup>
</FormControl>Checkbox
Multiple selections from a list, or single yes/no agreement.
<FormControl>
<FormLabel>Interests</FormLabel>
<FormGroup>
<FormControlLabel
control={<Checkbox checked={values.web} onChange={handleChange} name="web" />}
label="Web Development"
/>
<FormControlLabel
control={<Checkbox checked={values.data} onChange={handleChange} name="data" />}
label="Data Science"
/>
</FormGroup>
</FormControl>Form Field States
Text Field
Text Field
Segmented Tabs
Track background
#F0F0F1gray100Track radius
8pxradiusMdTrack padding
3pxActive tab bg
#FFFFFFsurfaceLightActive tab shadow
0 1px 2px rgba(0,0,0,0.08)Tab height
30pxTab font
14px500Active text
#141414gray900Inactive text
#6B6B72gray500Component Map
Each piece of the Form Editor maps to an existing atomic component or theme override.
Breadcrumb bar
Breadcrumbs + AppBar52px topbarSegmented tabs
Tabs + TabBuilder / Preview toggleField types panel
List + ListItemButtonleft sidebar, 150pxForm canvas
BoxbgLight background, centered max-widthField wrapper
Box1px border default, 2px primary when selectedField input
TextFieldoutlined, inside wrapperSettings panel
Boxright sidebar, 200pxRequired toggle
Switchprimary color when onValidation inputs
TextFieldtype=number, min/max lengthBottom actions
Buttonoutlined Cancel + contained SaveInteraction Flow
Entry
User opens Form Editor from a workflow node. Breadcrumb shows full path. Builder tab is active by default.
Adding fields
User drags or clicks a field type from the left panel. A new field wrapper appears on the canvas.
Selecting a field
Clicking a field wrapper highlights it with 2px orange border + primaryLight background. The right panel shows its settings.
Configuring
User edits label, placeholder, required toggle, and validation rules in the settings panel. Changes reflect live on the canvas.
Preview
User clicks the "Preview" tab to see the form as end users would see it, without builder chrome.
Saving
User clicks "Save". Form configuration is persisted. "Cancel" discards changes and returns to the workflow.
Code
<Box
sx={{
border: isSelected ? '2px solid' : '1px solid',
borderColor: isSelected ? 'primary.main' : 'grey.200',
backgroundColor: isSelected ? 'primary.light' : 'white',
borderRadius: '10px',
p: 2,
cursor: 'pointer',
}}
onClick={() => setSelectedField(field.id)}
>
{children}
</Box><Tabs value={activeTab} onChange={(_, v) => setActiveTab(v)}>
<Tab label="Builder" />
<Tab label="Preview" />
</Tabs>
// Theme overrides handle the segmented control styling:
// - gray100 track background
// - white active tab with subtle shadow
// - hidden indicator