mirror of
https://github.com/msfjarvis/compose-lobsters
synced 2025-08-14 21:07:04 +05:30
feat(common): add a clickable icon to SearchBar
This commit is contained in:
parent
63c3e26f5c
commit
255439e2b4
1 changed files with 9 additions and 0 deletions
|
@ -14,6 +14,10 @@ import androidx.compose.foundation.layout.padding
|
|||
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||
import androidx.compose.foundation.text.KeyboardActions
|
||||
import androidx.compose.foundation.text.KeyboardOptions
|
||||
import androidx.compose.material.icons.Icons
|
||||
import androidx.compose.material.icons.outlined.Search
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.material3.IconButton
|
||||
import androidx.compose.material3.MaterialTheme
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.material3.TextField
|
||||
|
@ -43,6 +47,11 @@ fun SearchBar(
|
|||
shape = RoundedCornerShape(topStart = 16.dp, topEnd = 16.dp),
|
||||
textStyle = MaterialTheme.typography.bodyLarge,
|
||||
placeholder = { Text(text = "Search") },
|
||||
trailingIcon = {
|
||||
IconButton(onClick = { onSearch(value) }) {
|
||||
Icon(imageVector = Icons.Outlined.Search, contentDescription = "Search")
|
||||
}
|
||||
},
|
||||
keyboardActions = KeyboardActions(onSearch = { onSearch(value) }),
|
||||
keyboardOptions =
|
||||
KeyboardOptions(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue