Tab
A default Tab, also known as a Primary Navigation Tab. Tabs organize content across different screens, data sets, and other interactions.
A Tab represents a single page of content using a text label and/or icon. It represents its selected state by tinting the text label and/or image with selectedContentColor.
This should typically be used inside of a TabRow, see the corresponding documentation for example usage.
This Tab has slots for text and/or icon - see the other Tab overload for a generic Tab that is not opinionated about its content.
Parameters
whether this tab is selected or not
called when this tab is clicked
the Modifier to be applied to this tab
controls the enabled state of this tab. When false
, this component will not respond to user input, and it will appear visually disabled and disabled to accessibility services.
the text label displayed in this tab
the icon displayed in this tab
the color for the content of this tab when selected, and the color of the ripple.
the color for the content of this tab when not selected
an optional hoisted MutableInteractionSource for observing and emitting Interactions for this tab. You can use this to change the tab's appearance or preview the tab in different states. Note that if null
is provided, interactions will still happen internally.
See also
Tabs organize content across different screens, data sets, and other interactions.
Generic Tab overload that is not opinionated about content / color. See the other overload for a Tab that has specific slots for text and / or an icon, as well as providing the correct colors for selected / unselected states.
A custom tab using this API may look like:
Parameters
whether this tab is selected or not
called when this tab is clicked
the Modifier to be applied to this tab
controls the enabled state of this tab. When false
, this component will not respond to user input, and it will appear visually disabled and disabled to accessibility services.
the color for the content of this tab when selected, and the color of the ripple.
the color for the content of this tab when not selected
an optional hoisted MutableInteractionSource for observing and emitting Interactions for this tab. You can use this to change the tab's appearance or preview the tab in different states. Note that if null
is provided, interactions will still happen internally.
the content of this tab