Package-level declarations

Types

Link copied to clipboard
interface BasicFormField
Link copied to clipboard

A mutable implementation of FieldMeta that tracks field-level metadata.

Link copied to clipboard
fun interface FieldRule<T>

A functional interface for field validation rules.

Link copied to clipboard
interface Form<T> : FormData<T> , HasFormBinding<T>

A form interface that provides form state management and submission handling.

Link copied to clipboard
interface FormBinding<T>

Internal interface for form binding operations.

Link copied to clipboard

A control interface for managing individual form field state and interactions.

Link copied to clipboard

A mutable implementation of FormMeta that tracks form-level metadata.

Link copied to clipboard
interface FormPolicy

Defines the policy configuration for form validation behavior.

Link copied to clipboard
class FormState<T>(value: T, val meta: FormMetaState) : FormData<T>

A mutable implementation of FormData that manages form state.

Link copied to clipboard

Interface for objects that have access to form binding operations.

Properties

Link copied to clipboard

Whether the field currently has any validation errors.

Link copied to clipboard

A minimal form policy that performs validation only on form submission.

Functions

Link copied to clipboard
fun <T, V> Form<T>.Field(selector: (T) -> V, updater: T.(V) -> T, validator: FieldValidator<V>? = null, name: FieldName? = null, dependsOn: FieldNames? = null, enabled: Boolean = true, render: @Composable (FormField<V>) -> Unit)

Creates a form field with validation and state management.

fun <T, V, S, U> Form<T>.Field(selector: (T) -> V, updater: T.(V) -> T, adapter: FieldTypeAdapter<V, S, U>, validator: FieldValidator<S>? = null, name: FieldName? = null, dependsOn: FieldNames? = null, enabled: Boolean = true, render: @Composable (FormField<U>) -> Unit)

Creates a form field with type adaptation, validation, and state management.

Link copied to clipboard
fun FormPolicy(formOptions: FormOptions = FormOptions, fieldOptions: FieldOptions = FieldOptions): FormPolicy

Creates a FormPolicy with the specified form and field options.

Link copied to clipboard
fun <T, V> Form<T>.rememberField(selector: (T) -> V, updater: T.(V) -> T, validator: FieldValidator<V>? = null, name: FieldName? = null, dependsOn: FieldNames? = null, enabled: Boolean = true): FormField<V>

Creates and remembers a form field control with validation and state management.

fun <T, V, S, U> Form<T>.rememberField(selector: (T) -> V, updater: T.(V) -> T, adapter: FieldTypeAdapter<V, S, U>, validator: FieldValidator<S>? = null, name: FieldName? = null, dependsOn: FieldNames? = null, enabled: Boolean = true): FormField<U>

Creates and remembers a form field control with type adaptation, validation, and state management.

Link copied to clipboard
fun <T> rememberForm(state: FormState<T>, onSubmit: (T) -> Unit): Form<T>

Remembers a form with the given form state and submission handler.

fun <T> rememberForm(initialValue: T, saver: Saver<T, Any> = autoSaver(), policy: FormPolicy = FormPolicy(), onSubmit: (T) -> Unit): Form<T>

Remembers a form with the given initial value and submission handler.

Link copied to clipboard

Remembers form metadata state with automatic state restoration.

Link copied to clipboard
fun <T> rememberFormState(initialValue: T, saver: Saver<T, Any> = autoSaver(), policy: FormPolicy = FormPolicy()): FormState<T>

Remembers a form state for the given initial value.

Link copied to clipboard
@ExperimentalSerializationApi
inline fun <T : Any> serializationSaver(serializer: KSerializer<T> = serializer(), configuration: SavedStateConfiguration = SavedStateConfiguration.DEFAULT): Saver<T, Any>

Create an Saver for Kotlin Serialization.

Link copied to clipboard
fun <T, R> Form<T>.watch(calculation: FormData<T>.() -> R): R

Watches for changes in form state and recomputes a derived value.