item
open fun item(text: String, selected: Boolean, modifier: Modifier = Modifier, unreadCount: Int = 0, itemIcon: @Composable () -> Unit?)
New item overload that accepts arbitrary Composable content as the icon/leading. Use this to pass custom visuals (e.g., vector icons, avatars, animated content).
Parameters
text
The text of the item.
selected
The selected state of the item.
modifier
The modifier of the item.
unreadCount
The unread count of the item.
itemIcon
Composable content rendered as the leading icon.
open fun item(text: String, selected: Boolean, modifier: Modifier = Modifier, icon: @Composable () -> Painter? = null, unreadCount: Int = 0)
Deprecated
Use the legacy item() only for Painter icons. Prefer the new overload that accepts Composable icon content.
Replace with
item(text, selected, modifier, unreadCount, itemIcon)Content copied to clipboard
item is a function that provides the item to the TabBar.
Parameters
text
The text of the item.
selected
The selected state of the item.
modifier
The modifier of the item.
icon
The icon of the item. use Painter to provide the icon.
unreadCount
The unread count of the item.