Form

fun Form(editor: DocumentEditor, mode: Mode = Mode.fill, maxAllowedSizeMB: Int? = null, onUpload: suspend (ComponentEvent<AbstractFileEditor>) -> List<String>? = null, onCapture: suspend (ComponentEvent<AbstractCompStringEditor>) -> String?? = null, onBlur: (event: ComponentEvent<*>) -> Unit? = null, onFocus: (event: ComponentEvent<*>) -> Unit? = null, license: String? = Secrets.LICENSE, allowDuplicatingPages: Boolean = true, navigation: @Composable (navigator: PageCollection, state: PageCollectionState) -> Unit? = { navigator, state -> if (state.pages.isNotEmpty()) { JoyPageSelector( state = state, allowDuplicatingPages = allowDuplicatingPages && mode != Mode.readonly, onChange = { navigator.navigate(it) }, onDuplicate = { navigator.duplicate(it, it.name) } ) } }, error: @Composable (Error) -> Unit = { ErrorFormState(it) }, onFieldChange: (event: ComponentEvent<*>) -> Unit? = null, showUnsupportedFields: Boolean = false, showUnsupportedColumns: Boolean = true, showRowNumbers: Boolean = true, modifier: Modifier = Modifier, arrangement: Arrangement.Vertical = Arrangement.spacedBy(16.dp), contentPadding: PaddingValues = PaddingValues(0.dp))

High-level composable to render a document using a DocumentEditor. Orchestrates page navigation, component rendering and event emission.

Parameters

editor

Editor providing pages, fields and validation.

mode

Rendering mode (e.g., fill vs readonly) controlling interactivity.

maxAllowedSizeMB

Optional file upload size limit (MB) for file components.

onUpload

Async handler to upload files; used by file/image components.

onCapture

Async handler to capture barcode/signature content.

onBlur

Callback when a component loses focus.

onFocus

Callback when a component gains focus.

license

License string used to enable licensed features.

allowDuplicatingPages

Whether user can duplicate pages via navigation UI.

navigation

Slot for a custom page navigator; provided default shows page tabs.

error

Error UI when editor.error is non-null.

onFieldChange

Callback invoked on component value changes.

showUnsupportedFields

If true, render a placeholder for unsupported editors.

showUnsupportedColumns

If true, render placeholder for unsupported table columns.

showRowNumbers

If true, display row numbers in table components.

modifier

Layout modifier for the content area.

arrangement

Vertical spacing arrangement between rows.

contentPadding

Padding applied to the list of components.