ShellTab

class ShellTab(val key: NavKey, @StringRes val label: Int, val icon: ToolkitIcon, val selectedIcon: ToolkitIcon = icon, val badge: String? = null, val badgeText: @Composable () -> String?? = null, val search: TabSearch? = null, @StringRes val shortLabel: Int? = null)(source)

A root of the shell, as it appears in the navigation bar, the rail and the permanent drawer.

icon and selectedIcon take any ToolkitIcon: an animated vector drawable or a Lottie icon plays when the tab is clicked or becomes selected, as in the Toolkit's other navigation items. Pass the same animated icon for both to play one animation for both states.

A tab shows badge, a fixed label, or badgeText, read in composition so it follows state such as an unread count. Either one returning null shows no badge, and an empty string shows a dot.

Constructors

Link copied to clipboard
constructor(key: NavKey, @StringRes label: Int, icon: ToolkitIcon, selectedIcon: ToolkitIcon = icon, badge: String? = null, badgeText: @Composable () -> String?? = null, search: TabSearch? = null, @StringRes shortLabel: Int? = null)

Properties

Link copied to clipboard
Link copied to clipboard
val badgeText: @Composable () -> String??
Link copied to clipboard
Link copied to clipboard
val key: NavKey
Link copied to clipboard
val label: Int
Link copied to clipboard

When set, the tab's app bar holds a search field in place of the title.

Link copied to clipboard
Link copied to clipboard

A shorter label for the places with little room under an icon: the navigation bar and the collapsed rail. label is used everywhere else, and there too when this is null.