KPDropdown

fun KPDropdown(style: DropdownStyle, value: String, modifier: Modifier = Modifier, label: String? = null, placeholder: String? = null, errorLabel: String? = null, isError: Boolean = false, enabled: Boolean = true, colors: TextFieldColors = style.outlinedTextFieldColors, onClick: () -> Unit)

A Composable function to render a dropdown UI component.

Parameters

style

Style configuration for the Dropdown. It should implement the DropdownStyle interface. This parameter determines the appearance of the dropdown, including the shape of the outer frame, the visibility of the label, and other style properties. For example, the styles defined within KPDropdownStyle represent the customized dropdown styles.

value

The currently selected value in the dropdown.

modifier

Modifier to apply to the Dropdown.

label

The label text to display above the dropdown.

placeholder

Optional placeholder text displayed when the dropdown is not selected.

errorLabel

The error message to display below the dropdown when an error occurs.

isError

Indicates whether the dropdown is in an error state.

enabled

Determines if the dropdown is enabled for interaction.

colors

The colors configuration for the dropdown. This parameter allows configuring the colors of the dropdown component, including the text color, background color, and colors for different states (such as selected, focused, disabled, etc.). TextFieldColors provides the means to customize these colors according to the desired visual appearance.

onClick

Callback for when the dropdown is clicked.