Input

SKTextField

SKTextField covers the full input lifecycle: idle, focused, filled, error, disabled and read-only. It ships with leading/trailing slots, character counters and a validation contract that the SKOne Form Framework binds to directly. Since 1.3.2-alpha03 the Compose implementation adds an integrated floating-label outlined field — the label transitions between resting and floating states, with refined focus, hint, supporting-text, error, disabled and required states. The public API is unchanged, and the XML implementation keeps its existing label behaviour.

Stablesince 1.3.0Compose · XMLAll components

Usage

SKTextField.kt
SKTextField(
    value = email,
    onValueChange = { email = it },
    label = "Work email",
    hint = "Enter your work email"
)

Props

PropTypeDefaultDescription
valueString—Current field value.
onValueChange(String) -> Unit—Change callback.
labelString?nullIntegrated label; in Compose it transitions between resting and floating states.
hintString?nullHint shown while the field is empty and unfocused.
variantSKFieldVariantOutlinedOutlined, Filled or Underlined.
errorString?nullError text; switches the field to the error state.

Accessibility

Label is programmatically associated with the field, error text is announced via a live region, and the touch target is at least 48dp.

Theming

Outline, filled and underlined variants read from SKTheme.shapes and SKTheme.colors.

API surface

  • SKTextField
  • SKFieldVariant
  • SKFieldState

Related