FormElement

Single form control (Craft resolvedName FormElement). Props use type (not inputType) for the HTML input kind.

Required Props: id, type

Structure

All styling goes in props.className as a single Tailwind utility string. Non-class props (text, src, alt, etc.) stay on their own keys. root.animation for scroll effects.

Properties

PropertyTypeDescriptionExamples
type*requiredstring
text | textarea | email | password | url | tel | date | datetime-local | radio | checkbox | select | reset | hidden | color | month | number | range | search | time | week | file |
HTML input type / control kind
email
textstring
Optional label or helper text content
-
tagNamestring
Override wrapper tag when applicable
-
activeTabnumber
-
-
placeholderstring
Placeholder text
Enter your email
namestring
Form field name attribute
email
labelstring
Visible label
-
requiredboolean
HTML required
Default: false
-
disabledboolean
-
Default: false
-
readOnlyboolean
-
Default: false
-
valuestring
Default value
-
rowsnumber
textarea rows
Default: 4
-
colsnumber
textarea cols
Default: 50
-
minstring
-
-
maxstring
-
-
stepstring
-
-
patternstring
-
-
autoCompletestring
HTML autocomplete attribute (React camelCase)
-
optionsarray
Select/radio options
Default: []
-
invalidboolean
Mark field invalid for styling
-
canDeleteboolean
-
Default: true
-
canEditNameboolean
-
Default: true
-
customobject
Editor metadata (displayName, ...)
-
classNamestring
Tailwind utility classes string. Mobile-first: unprefixed = base, md: = 768px+, sm: = 640px+, lg: = 1024px+. Includes layout, spacing, surface design, and typography.
flex flex-col gap-space-sm py-space-lg px-container-x md:flex-rowbg-primary text-primary-content rounded-box py-3.5 px-6 font-semibold
urlstring
-
-
urlTargetstring
-
-
rolestring
-
-
aria-labelstring
-
-
aria-hiddenstring
-
-
aria-describedbystring
-
-
aria-livestring
polite | assertive | off
-
-
rootobject
Input chrome: border, radius, focus ring, placeholder color
-