FormScope

A scope to manage the state and actions of input fields in a form.

Parameters

T

The type of the form value.

Properties

Link copied to clipboard

The current form state.

Functions

Link copied to clipboard
fun <V> rememberFieldControl(name: FieldName, select: T.() -> V, update: T.(V) -> T, enabled: T.() -> Boolean = { true }, dependsOn: Set<FieldName>? = null, validate: T.() -> FieldErrors?? = null): FieldControl<V>

Remembers a field control for the given field name.

Link copied to clipboard
fun <T : Any, V> FormScope<T>.rememberFieldRuleControl(name: FieldName, select: T.() -> V, update: T.(V) -> T, enabled: T.() -> Boolean = { true }, dependsOn: Set<FieldName>? = null, builder: ValidationRuleBuilder<V>.() -> Unit): FieldControl<V>
fun <T : Any, V> FormScope<T>.rememberFieldRuleControl(name: FieldName, select: T.() -> V, update: T.(V) -> T, enabled: T.() -> Boolean = { true }, dependsOn: Set<FieldName>? = null, ruleSet: ValidationRuleSet<V>): FieldControl<V>

Remembers a field control for the given field name with the given rule set.

Link copied to clipboard

Remembers a submission control for the form.

Link copied to clipboard

Remembers a submission rule control that automatically controls state of the form.

Link copied to clipboard
fun <T : Any, V> FormScope<T>.rememberWatch(select: T.() -> V): V

Remembers a watch value that automatically updates when the form state changes.