StylishFormField

fun StylishFormField(modifier: Modifier = Modifier, label: String? = null, required: Boolean = false, isError: Boolean = false, errorMessage: String? = null, supportingText: String? = null, labelStyle: TextStyle = MaterialTheme.typography.labelLarge, supportingTextStyle: TextStyle = MaterialTheme.typography.bodySmall, content: @Composable () -> Unit)

A labeled form field wrapper — the web "Field/Form" pattern from shadcn/ui and Ant Design.

Composes a label (with an optional required marker), the content slot (the input itself), and supporting/error text below it. The error message takes precedence over the supporting text and is rendered in the error color.

Parameters

modifier

Modifier applied to the root column.

label

Optional label text shown above the content.

required

When true and label is set, an asterisk is shown next to the label. Defaults to false.

isError

Whether the field is in its error state. When true, errorMessage is rendered in the error color. Defaults to false.

errorMessage

Optional error text shown below the content.

supportingText

Optional helper text shown below the content when there is no error message.

labelStyle

Typography of the label. Defaults to MaterialTheme.typography.labelLarge.

supportingTextStyle

Typography of supportingText. Defaults to MaterialTheme.typography.bodySmall.

content

The input content (e.g. a text field).