Form
A Form to manage the state and actions of input fields, and create a child block of FormScope.
Usage:
Form(
onSubmit = {
// Handle submit
},
initialValue = "",
policy = FormPolicy.Minimal
) { // this: FormScope<String>
..
}
Note: If you are expecting state restoration on the Android platform, please check if the type specified in initialValue is restorable. Inside the Form, rememberSaveable
is used to manage input values, and runtime errors will be thrown from the API for unsupported types.
Parameters
The type of the form value.
The submit handler to call when the form is submit.
The initial value of the form.
The modifier to apply to this layout node.
The error handler to call when an error occurs on submit.
The saver to save and restore the form state.
The key to reset the form state.
The policy to apply to the form.
The coroutine scope to launch the submit handler.
The content block to create the child block of FormScope.