<Form>
A headless Form component for ReactLynx. It provides form context and a submit button that collects field values.
Basic Usage
Use <Form> to manage form state, handle form validation, and submission
Avoiding Keyboard Overlap
Prevent the on-screen keyboard from obscuring the input field by automatically adjusting the view when the keyboard appears
Structure
API
FormRoot
childreniOSAndroidHarmony
The content of the form.
initialValuesiOSAndroidHarmony
The initial values of the form fields.
onChangediOSAndroidHarmony
Callback function triggered when any field's value changes. It receives the entire form's data.
onSubmitiOSAndroidHarmony
Callback function triggered when the form is submitted.
FormField
asiOSAndroidHarmony
Specifies the type of component to render.
childreniOSAndroidHarmony
The child elements of the form field, usually used for labels or complex structures.
classNameiOSAndroidHarmony
className
confirmTypeiOSAndroidHarmony
The type of confirm button
idiOSAndroidHarmony
The id of the input
inputFilteriOSAndroidHarmony
Filter the input content and process it in the form of regular expressions
maxLengthiOSAndroidHarmony
Max input length
nameiOSAndroidHarmony
The unique identifier for the form field.
onBluriOSAndroidHarmony
Blurred
onChangediOSAndroidHarmony
Callback function triggered when this specific field's value changes.
onConfirmiOSAndroidHarmony
Confirm button clicked
onFocusiOSAndroidHarmony
Focused
onSelectionChangeiOSAndroidHarmony
Input selection changed
placeholderiOSAndroidHarmony
Placeholder
readonlyiOSAndroidHarmony
Interaction enabled
ref
showSoftInputOnFocusiOSAndroidHarmony
Show soft input keyboard while focused
styleiOSAndroidHarmony
style
typeiOSAndroidHarmony
Input content type
disablediOSAndroidHarmony
If set to true, the RadioGroup can not accept interactions.
checkboxPropsiOSAndroid
Checkbox supports original view props to be directly spread in this prop.
indeterminateiOSAndroid
The indeterminate state of the Checkbox.
bouncesiOS
Bounce effect for iOS
lineSpacingiOSAndroid
Line spacing
maxLinesiOSAndroidHarmony
Max input lines
switchPropsiOSAndroid
Switch supports original view props to be directly spread in this prop.
FormSubmitButton
buttonPropsiOSAndroidHarmony
Button supports original view props to be directly spread in this prop.
classNameiOSAndroidHarmony
className
disablediOSAndroidHarmony
Determines whether the button is disabled.
onSubmitiOSAndroidHarmony
Callback function triggered when the submit button is clicked, after the form's internal submit logic.
styleiOSAndroidHarmony
style
childreniOSAndroidHarmony
children
State-based styling & rendering
This component exposes each of its internal states through two interchangeable channels, and the table below maps them one-to-one:
- CSS className — a class like
ui-<state>is toggled on the root node, so you can style it with selectors such as.ui-<state> { ... }. - Render-prop field — when
childrenis a function, the same state is passed in viachildren({ <state>: boolean, ... })for runtime-driven rendering.
ui-active
Whether the button is currently being pressed (and not disabled).
Applied when `status.active` is true.
ui-disabled
Whether the button is disabled.
Applied when `status.disabled` is true.