compose-form
1.0.0indexedLightweight, customizable form-builder DSL with reusable fields, built-in field and form validation, stateful ViewModel access, change observation, and custom input field support.
0
Stars
—
Used by
dependents
—
Health
/ 100
Lightweight, customizable form-builder DSL with reusable fields, built-in field and form validation, stateful ViewModel access, change observation, and custom input field support.
A lightweight and customisable Form builder DSL for Compose Multiplatform
dependencies{
...
implementation("io.github.idscodelabs:compose-form:$version")
}
commonMain.dependencies{
...
implementation("io.github.idscodelabs:compose-form:$version")
}
[versions]
compose-form = "<version>"
[libraries]
compose-form = { module = "io.github.idscodelabs:compose-form", version.ref = "compose-form" }
commonMain.dependencies{
...
implementation(libs.compose.form)
}
// Define your model
data class FormTextFieldExampleModel(
var value: String? = null,
)
...
// Create the form
Form(emptyModel = ::FormTextFieldExampleModel) {
// Add fields
FormTextField(
modelProperty = FormTextFieldExampleModel::value,
validator = NotEmptyValidator(), // Add validation
updateModel = { value = it },
hint = "Value"
)
// Submit the form
Button(onClick = submitFunction {
// Do something with the result
}) {
Text()
}
}
Surfaced from shared tags and platforms — no rankings paid for.