Form controls and selection components for user input, including text fields, checkboxes, radio buttons, and sliders. These components provide accessible, Material3-styled interfaces for data collection and user preferences.
import androidx.compose.material3.*
import androidx.compose.material3.TextField
import androidx.compose.material3.OutlinedTextField
import androidx.compose.material3.Checkbox
import androidx.compose.material3.RadioButton
import androidx.compose.material3.Slider
import androidx.compose.material3.TextFieldDefaultsStandard Material3 text input field with filled background and underline indicator.
/**
* Material3 text field with filled background for text input
* @param value Current text value displayed in the field
* @param onValueChange Callback invoked when text value changes
* @param modifier Modifier to be applied to the text field
* @param enabled Whether the text field is enabled for input
* @param readOnly Whether the text field is read-only (shows cursor but prevents editing)
* @param textStyle Style configuration for the input text
* @param label Optional label displayed above the text field
* @param placeholder Optional placeholder text shown when field is empty
* @param leadingIcon Optional icon displayed at the start of the field
* @param trailingIcon Optional icon displayed at the end of the field
* @param prefix Optional text prefix displayed before user input
* @param suffix Optional text suffix displayed after user input
* @param supportingText Optional supporting text displayed below the field
* @param isError Whether the text field is in error state
* @param visualTransformation Transformation for visual display (e.g., password masking)
* @param keyboardOptions Configuration for keyboard type and IME actions
* @param keyboardActions Configuration for keyboard action handling
* @param singleLine Whether the text field is single line (true) or multi-line (false)
* @param maxLines Maximum number of lines for multi-line fields
* @param minLines Minimum number of lines for multi-line fields
* @param interactionSource Source for tracking interaction states
* @param shape Shape of the text field container
* @param colors Color scheme for the text field in different states
*/
@Composable
fun TextField(
value: String,
onValueChange: (String) -> Unit,
modifier: Modifier = Modifier,
enabled: Boolean = true,
readOnly: Boolean = false,
textStyle: TextStyle = LocalTextStyle.current,
label: (@Composable () -> Unit)? = null,
placeholder: (@Composable () -> Unit)? = null,
leadingIcon: (@Composable () -> Unit)? = null,
trailingIcon: (@Composable () -> Unit)? = null,
prefix: (@Composable () -> Unit)? = null,
suffix: (@Composable () -> Unit)? = null,
supportingText: (@Composable () -> Unit)? = null,
isError: Boolean = false,
visualTransformation: VisualTransformation = VisualTransformation.None,
keyboardOptions: KeyboardOptions = KeyboardOptions.Default,
keyboardActions: KeyboardActions = KeyboardActions.Default,
singleLine: Boolean = false,
maxLines: Int = if (singleLine) 1 else Int.MAX_VALUE,
minLines: Int = 1,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
shape: Shape = TextFieldDefaults.shape,
colors: TextFieldColors = TextFieldDefaults.colors()
)Usage Examples:
// Basic text field
var text by remember { mutableStateOf("") }
TextField(
value = text,
onValueChange = { text = it },
label = { Text("Enter text") }
)
// Text field with placeholder and icon
var email by remember { mutableStateOf("") }
TextField(
value = email,
onValueChange = { email = it },
label = { Text("Email") },
placeholder = { Text("example@email.com") },
leadingIcon = { Icon(Icons.Default.Email, contentDescription = null) },
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Email)
)
// Password field
var password by remember { mutableStateOf("") }
var passwordVisible by remember { mutableStateOf(false) }
TextField(
value = password,
onValueChange = { password = it },
label = { Text("Password") },
visualTransformation = if (passwordVisible) VisualTransformation.None else PasswordVisualTransformation(),
trailingIcon = {
IconButton(onClick = { passwordVisible = !passwordVisible }) {
Icon(
if (passwordVisible) Icons.Default.Visibility else Icons.Default.VisibilityOff,
contentDescription = if (passwordVisible) "Hide password" else "Show password"
)
}
},
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Password)
)Text field with outline border and transparent background for form interfaces.
/**
* Material3 outlined text field with border stroke and transparent background
* @param value Current text value displayed in the field
* @param onValueChange Callback invoked when text value changes
* @param modifier Modifier to be applied to the text field
* @param enabled Whether the text field is enabled for input
* @param readOnly Whether the text field is read-only
* @param textStyle Style configuration for the input text
* @param label Optional label displayed as floating label
* @param placeholder Optional placeholder text shown when field is empty
* @param leadingIcon Optional icon displayed at the start of the field
* @param trailingIcon Optional icon displayed at the end of the field
* @param prefix Optional text prefix displayed before user input
* @param suffix Optional text suffix displayed after user input
* @param supportingText Optional supporting text displayed below the field
* @param isError Whether the text field is in error state
* @param visualTransformation Transformation for visual display
* @param keyboardOptions Configuration for keyboard type and IME actions
* @param keyboardActions Configuration for keyboard action handling
* @param singleLine Whether the text field is single line
* @param maxLines Maximum number of lines for multi-line fields
* @param minLines Minimum number of lines for multi-line fields
* @param interactionSource Source for tracking interaction states
* @param shape Shape of the text field border
* @param colors Color scheme for the text field in different states
*/
@Composable
fun OutlinedTextField(
value: String,
onValueChange: (String) -> Unit,
modifier: Modifier = Modifier,
enabled: Boolean = true,
readOnly: Boolean = false,
textStyle: TextStyle = LocalTextStyle.current,
label: (@Composable () -> Unit)? = null,
placeholder: (@Composable () -> Unit)? = null,
leadingIcon: (@Composable () -> Unit)? = null,
trailingIcon: (@Composable () -> Unit)? = null,
prefix: (@Composable () -> Unit)? = null,
suffix: (@Composable () -> Unit)? = null,
supportingText: (@Composable () -> Unit)? = null,
isError: Boolean = false,
visualTransformation: VisualTransformation = VisualTransformation.None,
keyboardOptions: KeyboardOptions = KeyboardOptions.Default,
keyboardActions: KeyboardActions = KeyboardActions.Default,
singleLine: Boolean = false,
maxLines: Int = if (singleLine) 1 else Int.MAX_VALUE,
minLines: Int = 1,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
shape: Shape = OutlinedTextFieldDefaults.shape,
colors: TextFieldColors = OutlinedTextFieldDefaults.colors()
)Usage Examples:
// Basic outlined text field
var text by remember { mutableStateOf("") }
OutlinedTextField(
value = text,
onValueChange = { text = it },
label = { Text("Outlined field") }
)
// Multi-line outlined text field
var description by remember { mutableStateOf("") }
OutlinedTextField(
value = description,
onValueChange = { description = it },
label = { Text("Description") },
singleLine = false,
maxLines = 4,
minLines = 2
)Boolean selection checkbox for multiple choice selections.
/**
* Material3 checkbox for boolean selection
* @param checked Whether the checkbox is currently checked
* @param onCheckedChange Callback invoked when checked state changes (null for read-only)
* @param modifier Modifier to be applied to the checkbox
* @param enabled Whether the checkbox is enabled for interaction
* @param colors Color scheme for the checkbox in different states
* @param interactionSource Source for tracking interaction states
*/
@Composable
fun Checkbox(
checked: Boolean,
onCheckedChange: ((Boolean) -> Unit)?,
modifier: Modifier = Modifier,
enabled: Boolean = true,
colors: CheckboxColors = CheckboxDefaults.colors(),
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }
)Usage Examples:
// Basic checkbox
var checked by remember { mutableStateOf(false) }
Checkbox(
checked = checked,
onCheckedChange = { checked = it }
)
// Checkbox with label
Row(
verticalAlignment = Alignment.CenterVertically
) {
var termsAccepted by remember { mutableStateOf(false) }
Checkbox(
checked = termsAccepted,
onCheckedChange = { termsAccepted = it }
)
Text(
text = "I accept the terms and conditions",
modifier = Modifier.padding(start = 8.dp)
)
}
// Tristate checkbox (indeterminate state)
var parentChecked by remember { mutableStateOf(ToggleableState.Indeterminate) }
TriStateCheckbox(
state = parentChecked,
onClick = {
parentChecked = when (parentChecked) {
ToggleableState.On -> ToggleableState.Off
ToggleableState.Off -> ToggleableState.On
ToggleableState.Indeterminate -> ToggleableState.On
}
}
)Three-state checkbox supporting checked, unchecked, and indeterminate states for hierarchical selections.
/**
* Material3 tri-state checkbox supporting indeterminate state for hierarchical selections
* @param state Current state of the checkbox (On, Off, or Indeterminate)
* @param onClick Callback invoked when checkbox is clicked (null for read-only)
* @param modifier Modifier to be applied to the checkbox
* @param enabled Whether the checkbox is enabled for interaction
* @param colors Color scheme for the checkbox in different states
* @param interactionSource Source for tracking interaction states
*/
@Composable
fun TriStateCheckbox(
state: ToggleableState,
onClick: (() -> Unit)?,
modifier: Modifier = Modifier,
enabled: Boolean = true,
colors: CheckboxColors = CheckboxDefaults.colors(),
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }
)Single selection radio button for exclusive choices.
/**
* Material3 radio button for single selection from a group
* @param selected Whether the radio button is currently selected
* @param onClick Callback invoked when radio button is clicked (null for read-only)
* @param modifier Modifier to be applied to the radio button
* @param enabled Whether the radio button is enabled for interaction
* @param colors Color scheme for the radio button in different states
* @param interactionSource Source for tracking interaction states
*/
@Composable
fun RadioButton(
selected: Boolean,
onClick: (() -> Unit)?,
modifier: Modifier = Modifier,
enabled: Boolean = true,
colors: RadioButtonColors = RadioButtonDefaults.colors(),
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }
)Usage Examples:
// Radio button group
val options = listOf("Option 1", "Option 2", "Option 3")
var selectedOption by remember { mutableStateOf(options[0]) }
Column {
options.forEach { option ->
Row(
verticalAlignment = Alignment.CenterVertically
) {
RadioButton(
selected = selectedOption == option,
onClick = { selectedOption = option }
)
Text(
text = option,
modifier = Modifier.padding(start = 8.dp)
)
}
}
}Range selection slider for continuous value input.
/**
* Material3 slider for continuous value selection within a range
* @param value Current slider value
* @param onValueChange Callback invoked when slider value changes
* @param modifier Modifier to be applied to the slider
* @param enabled Whether the slider is enabled for interaction
* @param valueRange Range of values the slider can represent
* @param steps Number of discrete steps in the range (0 for continuous)
* @param onValueChangeFinished Callback invoked when user stops interacting
* @param colors Color scheme for the slider in different states
* @param interactionSource Source for tracking interaction states
*/
@Composable
fun Slider(
value: Float,
onValueChange: (Float) -> Unit,
modifier: Modifier = Modifier,
enabled: Boolean = true,
valueRange: ClosedFloatingPointRange<Float> = 0f..1f,
steps: Int = 0,
onValueChangeFinished: (() -> Unit)? = null,
colors: SliderColors = SliderDefaults.colors(),
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() }
)Range slider for selecting a range of values with start and end points.
/**
* Material3 range slider for selecting a range of values between two endpoints
* @param value Current range of values (ClosedFloatingPointRange)
* @param onValueChange Callback invoked when range values change
* @param modifier Modifier to be applied to the range slider
* @param enabled Whether the range slider is enabled for interaction
* @param valueRange Overall range of values the slider can represent
* @param steps Number of discrete steps in the range (0 for continuous)
* @param onValueChangeFinished Callback invoked when user stops interacting
* @param colors Color scheme for the range slider in different states
*/
@Composable
fun RangeSlider(
value: ClosedFloatingPointRange<Float>,
onValueChange: (ClosedFloatingPointRange<Float>) -> Unit,
modifier: Modifier = Modifier,
enabled: Boolean = true,
valueRange: ClosedFloatingPointRange<Float> = 0f..1f,
steps: Int = 0,
onValueChangeFinished: (() -> Unit)? = null,
colors: SliderColors = SliderDefaults.colors(),
)Usage Examples:
// Basic slider
var sliderValue by remember { mutableStateOf(0.5f) }
Slider(
value = sliderValue,
onValueChange = { sliderValue = it }
)
// Slider with custom range and steps
var volume by remember { mutableStateOf(50f) }
Column {
Text("Volume: ${volume.toInt()}")
Slider(
value = volume,
onValueChange = { volume = it },
valueRange = 0f..100f,
steps = 10
)
}
// Range slider for min/max selection
var sliderRange by remember { mutableStateOf(0.2f..0.8f) }
RangeSlider(
value = sliderRange,
onValueChange = { sliderRange = it },
valueRange = 0f..1f
)Default configurations for text fields.
object TextFieldDefaults {
/** Default shape for filled text fields */
val shape: Shape
/**
* Creates default colors for filled text fields
* @param focusedTextColor Text color when focused
* @param unfocusedTextColor Text color when not focused
* @param disabledTextColor Text color when disabled
* @param errorTextColor Text color in error state
* @param focusedContainerColor Background color when focused
* @param unfocusedContainerColor Background color when not focused
* @param disabledContainerColor Background color when disabled
* @param errorContainerColor Background color in error state
* @param cursorColor Color of the text cursor
* @param errorCursorColor Color of the cursor in error state
* @param focusedIndicatorColor Color of the indicator when focused
* @param unfocusedIndicatorColor Color of the indicator when not focused
* @param disabledIndicatorColor Color of the indicator when disabled
* @param errorIndicatorColor Color of the indicator in error state
* @param focusedLeadingIconColor Color of leading icon when focused
* @param unfocusedLeadingIconColor Color of leading icon when not focused
* @param disabledLeadingIconColor Color of leading icon when disabled
* @param errorLeadingIconColor Color of leading icon in error state
* @param focusedTrailingIconColor Color of trailing icon when focused
* @param unfocusedTrailingIconColor Color of trailing icon when not focused
* @param disabledTrailingIconColor Color of trailing icon when disabled
* @param errorTrailingIconColor Color of trailing icon in error state
* @param focusedLabelColor Color of label when focused
* @param unfocusedLabelColor Color of label when not focused
* @param disabledLabelColor Color of label when disabled
* @param errorLabelColor Color of label in error state
* @param focusedPlaceholderColor Color of placeholder when focused
* @param unfocusedPlaceholderColor Color of placeholder when not focused
* @param disabledPlaceholderColor Color of placeholder when disabled
* @param errorPlaceholderColor Color of placeholder in error state
* @param focusedSupportingTextColor Color of supporting text when focused
* @param unfocusedSupportingTextColor Color of supporting text when not focused
* @param disabledSupportingTextColor Color of supporting text when disabled
* @param errorSupportingTextColor Color of supporting text in error state
* @param focusedPrefixColor Color of prefix when focused
* @param unfocusedPrefixColor Color of prefix when not focused
* @param disabledPrefixColor Color of prefix when disabled
* @param errorPrefixColor Color of prefix in error state
* @param focusedSuffixColor Color of suffix when focused
* @param unfocusedSuffixColor Color of suffix when not focused
* @param disabledSuffixColor Color of suffix when disabled
* @param errorSuffixColor Color of suffix in error state
*/
fun colors(
focusedTextColor: Color = Color.Unspecified,
unfocusedTextColor: Color = Color.Unspecified,
disabledTextColor: Color = Color.Unspecified,
errorTextColor: Color = Color.Unspecified,
focusedContainerColor: Color = Color.Unspecified,
unfocusedContainerColor: Color = Color.Unspecified,
disabledContainerColor: Color = Color.Unspecified,
errorContainerColor: Color = Color.Unspecified,
cursorColor: Color = Color.Unspecified,
errorCursorColor: Color = Color.Unspecified,
focusedIndicatorColor: Color = Color.Unspecified,
unfocusedIndicatorColor: Color = Color.Unspecified,
disabledIndicatorColor: Color = Color.Unspecified,
errorIndicatorColor: Color = Color.Unspecified,
focusedLeadingIconColor: Color = Color.Unspecified,
unfocusedLeadingIconColor: Color = Color.Unspecified,
disabledLeadingIconColor: Color = Color.Unspecified,
errorLeadingIconColor: Color = Color.Unspecified,
focusedTrailingIconColor: Color = Color.Unspecified,
unfocusedTrailingIconColor: Color = Color.Unspecified,
disabledTrailingIconColor: Color = Color.Unspecified,
errorTrailingIconColor: Color = Color.Unspecified,
focusedLabelColor: Color = Color.Unspecified,
unfocusedLabelColor: Color = Color.Unspecified,
disabledLabelColor: Color = Color.Unspecified,
errorLabelColor: Color = Color.Unspecified,
focusedPlaceholderColor: Color = Color.Unspecified,
unfocusedPlaceholderColor: Color = Color.Unspecified,
disabledPlaceholderColor: Color = Color.Unspecified,
errorPlaceholderColor: Color = Color.Unspecified,
focusedSupportingTextColor: Color = Color.Unspecified,
unfocusedSupportingTextColor: Color = Color.Unspecified,
disabledSupportingTextColor: Color = Color.Unspecified,
errorSupportingTextColor: Color = Color.Unspecified,
focusedPrefixColor: Color = Color.Unspecified,
unfocusedPrefixColor: Color = Color.Unspecified,
disabledPrefixColor: Color = Color.Unspecified,
errorPrefixColor: Color = Color.Unspecified,
focusedSuffixColor: Color = Color.Unspecified,
unfocusedSuffixColor: Color = Color.Unspecified,
disabledSuffixColor: Color = Color.Unspecified,
errorSuffixColor: Color = Color.Unspecified,
): TextFieldColors
}Default configurations for outlined text fields.
object OutlinedTextFieldDefaults {
/** Default shape for outlined text fields */
val shape: Shape
/**
* Creates default colors for outlined text fields
* @param focusedTextColor Text color when focused
* @param unfocusedTextColor Text color when not focused
* @param disabledTextColor Text color when disabled
* @param errorTextColor Text color in error state
* @param focusedContainerColor Background color when focused (typically transparent)
* @param unfocusedContainerColor Background color when not focused (typically transparent)
* @param disabledContainerColor Background color when disabled
* @param errorContainerColor Background color in error state
* @param cursorColor Color of the text cursor
* @param errorCursorColor Color of the cursor in error state
* @param focusedBorderColor Color of the border when focused
* @param unfocusedBorderColor Color of the border when not focused
* @param disabledBorderColor Color of the border when disabled
* @param errorBorderColor Color of the border in error state
* @param focusedLeadingIconColor Color of leading icon when focused
* @param unfocusedLeadingIconColor Color of leading icon when not focused
* @param disabledLeadingIconColor Color of leading icon when disabled
* @param errorLeadingIconColor Color of leading icon in error state
* @param focusedTrailingIconColor Color of trailing icon when focused
* @param unfocusedTrailingIconColor Color of trailing icon when not focused
* @param disabledTrailingIconColor Color of trailing icon when disabled
* @param errorTrailingIconColor Color of trailing icon in error state
* @param focusedLabelColor Color of label when focused
* @param unfocusedLabelColor Color of label when not focused
* @param disabledLabelColor Color of label when disabled
* @param errorLabelColor Color of label in error state
* @param focusedPlaceholderColor Color of placeholder when focused
* @param unfocusedPlaceholderColor Color of placeholder when not focused
* @param disabledPlaceholderColor Color of placeholder when disabled
* @param errorPlaceholderColor Color of placeholder in error state
* @param focusedSupportingTextColor Color of supporting text when focused
* @param unfocusedSupportingTextColor Color of supporting text when not focused
* @param disabledSupportingTextColor Color of supporting text when disabled
* @param errorSupportingTextColor Color of supporting text in error state
* @param focusedPrefixColor Color of prefix when focused
* @param unfocusedPrefixColor Color of prefix when not focused
* @param disabledPrefixColor Color of prefix when disabled
* @param errorPrefixColor Color of prefix in error state
* @param focusedSuffixColor Color of suffix when focused
* @param unfocusedSuffixColor Color of suffix when not focused
* @param disabledSuffixColor Color of suffix when disabled
* @param errorSuffixColor Color of suffix in error state
*/
fun colors(
focusedTextColor: Color = Color.Unspecified,
unfocusedTextColor: Color = Color.Unspecified,
disabledTextColor: Color = Color.Unspecified,
errorTextColor: Color = Color.Unspecified,
focusedContainerColor: Color = Color.Unspecified,
unfocusedContainerColor: Color = Color.Unspecified,
disabledContainerColor: Color = Color.Unspecified,
errorContainerColor: Color = Color.Unspecified,
cursorColor: Color = Color.Unspecified,
errorCursorColor: Color = Color.Unspecified,
focusedBorderColor: Color = Color.Unspecified,
unfocusedBorderColor: Color = Color.Unspecified,
disabledBorderColor: Color = Color.Unspecified,
errorBorderColor: Color = Color.Unspecified,
focusedLeadingIconColor: Color = Color.Unspecified,
unfocusedLeadingIconColor: Color = Color.Unspecified,
disabledLeadingIconColor: Color = Color.Unspecified,
errorLeadingIconColor: Color = Color.Unspecified,
focusedTrailingIconColor: Color = Color.Unspecified,
unfocusedTrailingIconColor: Color = Color.Unspecified,
disabledTrailingIconColor: Color = Color.Unspecified,
errorTrailingIconColor: Color = Color.Unspecified,
focusedLabelColor: Color = Color.Unspecified,
unfocusedLabelColor: Color = Color.Unspecified,
disabledLabelColor: Color = Color.Unspecified,
errorLabelColor: Color = Color.Unspecified,
focusedPlaceholderColor: Color = Color.Unspecified,
unfocusedPlaceholderColor: Color = Color.Unspecified,
disabledPlaceholderColor: Color = Color.Unspecified,
errorPlaceholderColor: Color = Color.Unspecified,
focusedSupportingTextColor: Color = Color.Unspecified,
unfocusedSupportingTextColor: Color = Color.Unspecified,
disabledSupportingTextColor: Color = Color.Unspecified,
errorSupportingTextColor: Color = Color.Unspecified,
focusedPrefixColor: Color = Color.Unspecified,
unfocusedPrefixColor: Color = Color.Unspecified,
disabledPrefixColor: Color = Color.Unspecified,
errorPrefixColor: Color = Color.Unspecified,
focusedSuffixColor: Color = Color.Unspecified,
unfocusedSuffixColor: Color = Color.Unspecified,
disabledSuffixColor: Color = Color.Unspecified,
errorSuffixColor: Color = Color.Unspecified,
): TextFieldColors
}Default configurations for checkboxes.
object CheckboxDefaults {
/**
* Creates default colors for checkboxes
* @param checkedColor Color when checked
* @param uncheckedColor Color when unchecked
* @param checkmarkColor Color of the checkmark
* @param disabledCheckedColor Color when checked and disabled
* @param disabledUncheckedColor Color when unchecked and disabled
* @param disabledIndeterminateColor Color when indeterminate and disabled
*/
fun colors(
checkedColor: Color = Color.Unspecified,
uncheckedColor: Color = Color.Unspecified,
checkmarkColor: Color = Color.Unspecified,
disabledCheckedColor: Color = Color.Unspecified,
disabledUncheckedColor: Color = Color.Unspecified,
disabledIndeterminateColor: Color = Color.Unspecified,
): CheckboxColors
}Default configurations for radio buttons.
object RadioButtonDefaults {
/**
* Creates default colors for radio buttons
* @param selectedColor Color when selected
* @param unselectedColor Color when not selected
* @param disabledSelectedColor Color when selected and disabled
* @param disabledUnselectedColor Color when not selected and disabled
*/
fun colors(
selectedColor: Color = Color.Unspecified,
unselectedColor: Color = Color.Unspecified,
disabledSelectedColor: Color = Color.Unspecified,
disabledUnselectedColor: Color = Color.Unspecified,
): RadioButtonColors
}Default configurations for sliders.
object SliderDefaults {
/**
* Creates default colors for sliders
* @param thumbColor Color of the slider thumb
* @param activeTrackColor Color of the active track
* @param activeTickColor Color of active tick marks
* @param inactiveTrackColor Color of the inactive track
* @param inactiveTickColor Color of inactive tick marks
* @param disabledThumbColor Color of thumb when disabled
* @param disabledActiveTrackColor Color of active track when disabled
* @param disabledActiveTickColor Color of active ticks when disabled
* @param disabledInactiveTrackColor Color of inactive track when disabled
* @param disabledInactiveTickColor Color of inactive ticks when disabled
*/
fun colors(
thumbColor: Color = Color.Unspecified,
activeTrackColor: Color = Color.Unspecified,
activeTickColor: Color = Color.Unspecified,
inactiveTrackColor: Color = Color.Unspecified,
inactiveTickColor: Color = Color.Unspecified,
disabledThumbColor: Color = Color.Unspecified,
disabledActiveTrackColor: Color = Color.Unspecified,
disabledActiveTickColor: Color = Color.Unspecified,
disabledInactiveTrackColor: Color = Color.Unspecified,
disabledInactiveTickColor: Color = Color.Unspecified,
): SliderColors
}data class KeyboardOptions(
val capitalization: KeyboardCapitalization = KeyboardCapitalization.None,
val autoCorrect: Boolean = true,
val keyboardType: KeyboardType = KeyboardType.Text,
val imeAction: ImeAction = ImeAction.Default
)
enum class KeyboardType {
Text, Ascii, Number, Phone, Uri, Email, Password, NumberPassword
}
enum class ImeAction {
Default, None, Go, Search, Send, Previous, Next, Done
}interface VisualTransformation {
fun filter(text: AnnotatedString): TransformedText
companion object {
val None: VisualTransformation
}
}
class PasswordVisualTransformation(val mask: Char = '\u2022') : VisualTransformationenum class ToggleableState {
On, Off, Indeterminate
}