Class FormComposablesKt
-
- All Implemented Interfaces:
public final class FormComposablesKt
-
-
Method Summary
Modifier and Type Method Description final static <T extends Any> Form<T>form(KClass<T> className, T initialData, Function1<FormScope<T>, Unit> content)form ComposableThis composable setup the form declarative by taking it's class reference as a parameter. final static <T extends Any, V extends Any> FormField<V>field(FormScope<T> $self, KProperty1<T, V> fieldClass, Function1<FormFieldScope<V>, Unit> content)Field ComposableThis composable automatically registers the field in it's parent scope and accepts KProperty1 reference as a parameter. -
-
Method Detail
-
form
@Composable() final static <T extends Any> Form<T> form(KClass<T> className, T initialData, Function1<FormScope<T>, Unit> content)
form Composable
This composable setup the form declarative by taking it's class reference as a parameter. It accepts a composable content with FormScope as it's context. By using this FormScope context, you can register fields or call the field compose to setup field UIs
This composable returns a Form object which you can reference later to register more fields
- Parameters:
className- kotlin class reference of the formcontent- composable content
-
field
@Composable() final static <T extends Any, V extends Any> FormField<V> field(FormScope<T> $self, KProperty1<T, V> fieldClass, Function1<FormFieldScope<V>, Unit> content)
Field Composable
This composable automatically registers the field in it's parent scope and accepts KProperty1 reference as a parameter. It also accepts a composable content with a FormFieldScope as it's context. You can use this context to set the field value, observe it's state and validation results
- Parameters:
fieldClass- class reference of the form datacontent- composable content
-
-
-
-