Inputs & Forms
Inputs collect data from users: text fields, dropdowns, toggles, and checkboxes. Good inputs say what they expect, communicate errors gently, and let users correct mistakes. Every input needs a visible label (never rely on placeholder alone), a helpful error state for invalid data, and a disabled state when the action is unavailable. The CTD Learns App uses MUI's outlined variant for all inputs with the 8px border radius and the orange primary color for focus rings.
Interactive Preview
TextField — All states
Props
variant
outlined
label
placeholder
error
disabled
Helper text
Switch — Toggle control
Props
checked
disabled
label
Text Input States
Default
Focused
Error
This field is required
Disabled
Property
Value
Border radius
8pxradiusMdFont size
16pxbaseLabel
14px·
500Focus border
2pxprimary·
#E8541AError border
1pxdanger·
#EF4444Disabled
bg
#F7F7F8gray50·border
#C8C8CBgray300Textarea
Default
Focused
Select
Default
Filled
Active
Toggle / Switch
Property
Value
Track size
36 × 20pxThumb size
16pxActive color
#E8541AprimaryInactive color
#C8C8CBgray300Border radius
9999pxradiusFullCode
TextField
<TextField
label="Email address"
variant="outlined"
fullWidth
error={!!errors.email}
helperText={errors.email?.message}
/>Textarea
<TextField
label="Description"
variant="outlined"
fullWidth
multiline
minRows={3}
/>Select
<FormControl fullWidth>
<InputLabel>Status</InputLabel>
<Select label="Status" value={status}>
<MenuItem value="active">Active</MenuItem>
<MenuItem value="draft">Draft</MenuItem>
</Select>
</FormControl>Switch
<Switch
checked={darkMode}
onChange={(e) => setDarkMode(e.target.checked)}
/>