🌈 Create new beautiful Compose Gradients with our new wesite ->

DockedSearchBar

Kotlin
@Composable
fun DockedSearchBarSample() {
    val textFieldState = rememberTextFieldState()
    var expanded by remember { mutableStateOf(true) }

    DockedSearchBar(
        inputField = {
            TextField(
                state = textFieldState,
                placeholder = { Text("Search") },
                leadingIcon = { Icon(Icons.Filled.Search, contentDescription = null) },
                modifier = Modifier.fillMaxWidth(),
            )
        },
        expanded = expanded,
        onExpandedChange = { expanded = it },
    ) {
        ListItem(
            headlineContent = { Text("Recent search") },
            leadingContent = { Icon(Icons.Filled.History, contentDescription = null) },
        )
    }
}