androidx.compose.material3
Build Jetpack Compose UIs with Material 3 Expressive, the latest evolution of Material Design. M3 Expressive includes research-backed updates to theming, components, motion, typography, and more — all designed to help you make engaging and desirable products that users love. M3 Expressive compliments the Android 16 visual style and system UI.

In this page, you'll find documentation for types, properties, and functions available in the androidx.compose.material3 package.
For more information, check out Material Design 3 in Compose.
Overview
Theming
| APIs | Description | |
| Material Theming | MaterialTheme |
M3 theme |
| Color scheme | ColorScheme |
M3 color scheme |
lightColorScheme |
M3 light color scheme | |
darkColorScheme |
M3 dark color scheme | |
| Dynamic color | dynamicLightColorScheme | M3 dynamic light color scheme |
| dynamicDarkColorScheme | M3 dynamic dark color scheme | |
| Typography | Typography |
M3 typography |
| Shape | Shapes |
M3 shape |
Components
| APIs | Description | |
| Badge | Badge |
M3 badge |
BadgedBox |
M3 badged box | |
| Bottom app bar | BottomAppBar |
M3 bottom app bar |
| Bottom sheet | BottomSheetScaffold |
M3 bottom sheet |
ModalBottomSheet |
M3 modal bottom sheet | |
| Buttons | Button |
M3 filled button |
ElevatedButton |
M3 elevated button | |
FilledTonalButton |
M3 filled tonal button | |
OutlinedButton |
M3 outlined button | |
TextButton |
M3 text button | |
| Cards | Card |
M3 filled card |
ElevatedCard |
M3 elevated card | |
OutlinedCard |
M3 outlined card | |
| Checkbox | Checkbox |
M3 checkbox |
TriStateCheckbox |
M3 indeterminate checkbox | |
| Chips | AssistChip |
M3 assist chip |
ElevatedAssistChip |
M3 elevated assist chip | |
FilterChip |
M3 filter chip | |
ElevatedFilterChip |
M3 elevated filter chip | |
InputChip |
M3 input chip | |
SuggestionChip |
M3 suggestion chip | |
ElevatedSuggestionChip |
M3 elevated suggestion chip | |
| Date Picker | DatePicker |
M3 date picker |
DatePickerDialog |
M3 date picker embeeded in dialog | |
DateRangePicker |
M3 date range picker | |
| Dialogs | AlertDialog |
M3 basic dialog |
| Dividers | HorizontalDivider |
M3 horizontal divider |
VerticalDivider |
M3 vertical divider | |
| Extended FAB | ExtendedFloatingActionButton |
M3 extended FAB |
| FAB | FloatingActionButton |
M3 FAB |
SmallFloatingActionButton |
M3 small FAB | |
LargeFloatingActionButton |
M3 large FAB | |
| Icon button | IconButton |
M3 standard icon button |
IconToggleButton |
M3 standard icon toggle button | |
FilledIconButton |
M3 filled icon button | |
FilledIconToggleButton |
M3 filled icon toggle button | |
FilledTonalIconButton |
M3 filled tonal icon button | |
FilledTonalIconToggleButton |
M3 filled tonal icon toggle button | |
OutlinedIconButton |
M3 outlined icon button | |
OutlinedIconToggleButton |
M3 outlined icon toggle button | |
| Lists | ListItem |
M3 list item |
| Menus | DropdownMenu |
M3 menu |
DropdownMenuItem |
M3 menu item | |
ExposedDropdownMenuBox |
M3 exposed dropdown menu | |
| Navigation bar | NavigationBar |
M3 navigation bar |
NavigationBarItem |
M3 navigation bar item | |
| Navigation drawer | ModalNavigationDrawer |
M3 modal navigation drawer |
ModalDrawerSheet |
M3 modal drawer sheet | |
PermanentNavigationDrawer |
M3 permanent standard navigation drawer | |
PermanentDrawerSheet |
M3 permanent standard drawer sheet | |
DismissibleNavigationDrawer |
M3 dismissible standard navigation drawer | |
DismissibleDrawerSheet |
M3 dismissible standard drawer sheet | |
NavigationDrawerItem |
M3 navigation drawer item | |
| Navigation rail | NavigationRail |
M3 navigation rail |
NavigationRailItem |
M3 navigation rail item | |
| Progress indicators | LinearProgressIndicator |
M3 linear progress indicator |
CircularProgressIndicator |
M3 circular progress indicator | |
| Radio button | RadioButton |
M3 radio button |
| Search Bar | SearchBar |
M3 search bar |
DockedSearchBar |
M3 docked search bar | |
| Segmented Button | SegmentedButton |
M3 segmented button |
SingleChoiceSegmentedButtonRow |
M3 single choice segmented button row | |
MultiChoiceSegmentedButtonRow |
M3 multiple choice segmented button row | |
| Sliders | Slider |
M3 slider |
RangeSlider |
M3 range slider | |
| Snackbars | Snackbar |
M3 snackbar |
| Swipe to Dismiss | SwipeToDismissBox |
M3 swipe to dismiss |
| Switch | Switch |
M3 switch |
| Tabs | Tab |
M3 tab |
LeadingIconTab |
M3 leading icon tab | |
TabRowDefaults.PrimaryIndicator |
M3 primary tab indicator | |
PrimaryTabRow |
M3 primary tab row | |
TabRowDefaults.SecondaryIndicator |
M3 secondary tab indicator | |
SecondaryTabRow |
M3 secondary tab row | |
TabRow |
M3 fixed tab row | |
ScrollableTabRow |
M3 scrollable tab row | |
| Text fields | TextField |
M3 filled text field |
OutlinedTextField |
M3 outlined text field | |
| Time Picker | TimePicker |
M3 time picker |
TimeInput |
M3 time input | |
| Tool tip | PlainTooltip |
M3 plain tool tip |
RichTooltip |
M3 rich tool tip | |
| Top app bar | TopAppBar |
M3 small top app bar |
CenterAlignedTopAppBar |
M3 center-aligned top app bar | |
MediumTopAppBar |
M3 medium top app bar | |
LargeTopAppBar |
M3 large top app bar |
Surfaces and layout
| APIs | Description | |
| Surfaces | Surface |
M3 surface |
| Scaffold | Scaffold |
M3 layout |
Icons and text
| APIs | Description | |
| Icon | Icon |
M3 icon |
| Text | Text |
M3 text |
Also check out the androidx.compose.material.icons package.
Interfaces
AppBarColumnScope |
DSL scope for building the content of an |
Cmn
|
AppBarRowScope |
DSL scope for building the content of an |
Cmn
|
AppBarScope |
DSL scope for building the content of an |
Cmn
|
BottomAppBarScrollBehavior |
A BottomAppBarScrollBehavior defines how a bottom app bar should behave when the content under it is scrolled. |
Cmn
|
BottomAppBarState |
A state object that can be hoisted to control and observe the bottom app bar state. |
Cmn
|
ButtonGroupScope |
Button group scope used to indicate a |
Cmn
|
DatePickerFormatter |
A date formatter interface used by |
Cmn
|
DatePickerState |
A state object that can be hoisted to observe the date picker state. |
Cmn
|
DateRangePickerState |
A state object that can be hoisted to observe the date range picker state. |
Cmn
|
DropdownMenuPopupPositionProvider |
|
Cmn
|
FloatingActionButtonMenuScope |
Scope for the children of |
Cmn
|
FloatingToolbarScrollBehavior |
A FloatingToolbarScrollBehavior defines how a floating toolbar should behave when the content under it is scrolled. |
Cmn
|
FloatingToolbarState |
A state object that can be hoisted to control and observe the floating toolbar state. |
Cmn
|
MenuPositionScope |
Provides context for calculating candidate menu positioning coordinates relative to window bounds. |
Cmn
|
MotionScheme |
A motion scheme provides all the |
Cmn
|
MultiChoiceSegmentedButtonRowScope |
Scope for the children of a |
Cmn
|
NavigationDrawerItemColors |
Represents the colors of the various elements of a drawer item. |
Cmn
|
SearchBarScrollBehavior |
A |
Cmn
|
SelectableDates |
An interface that controls the selectable dates and years in the date pickers UI. |
Cmn
|
SingleChoiceSegmentedButtonRowScope |
Scope for the children of a |
Cmn
|
SnackbarData |
Interface to represent the data of one particular |
Cmn
|
SnackbarVisuals |
Interface to represent the visuals of one particular |
Cmn
|
TabIndicatorScope |
Scope for the composable used to render a Tab indicator, this can be used for more complex indicators requiring layout information about the tabs like |
Cmn
|
TextFieldLabelScope |
Scope for the label of a |
Cmn
|
TimePickerState |
A state object that can be hoisted to observe the time picker state. |
Cmn
|
ToggleFloatingActionButtonScope |
Scope for the children of |
Cmn
|
TooltipScope |
Tooltip scope for |
Cmn
|
TooltipState |
The state that is associated with a |
Cmn
|
TopAppBarScrollBehavior |
A TopAppBarScrollBehavior defines how an app bar should behave when the content under it is scrolled. |
Cmn
|
WideNavigationRailState |
A state object that can be hoisted to observe the wide navigation rail state. |
Cmn
|
Classes
AppBarMenuState |
State class for the overflow menu in |
Cmn
|
AppBarWithSearchColors |
Represents the colors used by an |
Cmn
|
BottomSheetScaffoldState |
State of the |
Cmn
|
ButtonColors |
Represents the container and content colors used in a button in different states. |
Cmn
|
ButtonElevation |
Represents the elevation for a button in different states. |
Cmn
|
ButtonGroupMenuState |
State class for the overflow menu in |
Cmn
|
ButtonShapes |
The shapes that will be used in buttons. |
Cmn
|
CalendarLocale |
Represents a Locale for the calendar. |
Cmn
android
|
CardColors |
Represents the container and content colors used in a card in different states. |
Cmn
|
CardElevation |
Represents the elevation for a card in different states. |
Cmn
|
CheckboxColors |
Represents the colors used by the three different sections (checkmark, box, and border) of a |
Cmn
|
ChipBorder |
This class is deprecated. Maintained for binary compatibility. |
Cmn
|
ChipColors |
Represents the container and content colors used in a clickable chip in different states. |
Cmn
|
ChipElevation |
Represents the elevation used in a selectable chip in different states. |
Cmn
|
ChipShapes |
The shapes that will be used in chips. |
Cmn
|
ColorScheme |
A color scheme holds all the named color parameters for a |
Cmn
|
DatePickerColors |
Represents the colors used by the date picker. |
Cmn
|
DefaultTooltipCaretShape |
Default |
Cmn
|
DisplayMode |
Represents the different modes that a date picker can be at. |
Cmn
|
DragHandleColors |
Specifies the colors that will be used in a drag handle in different states. |
Cmn
|
DragHandleShapes |
Specifies the shapes that will be used in a drag handle in different states. |
Cmn
|
DragHandleSizes |
Specifies the sizes that will be used in a drag handle in different states. |
Cmn
|
DrawerState |
State of the |
Cmn
|
ExposedDropdownMenuAnchorType |
The type of element that can serve as a dropdown menu anchor. |
Cmn
|
ExposedDropdownMenuBoxScope |
Scope for |
Cmn
|
FabPosition |
The possible positions for a |
Cmn
|
FloatingActionButtonElevation |
Represents the tonal and shadow elevation for a floating action button in different states. |
Cmn
|
FloatingToolbarColors |
Represents the container and content colors used in the various floating toolbars. |
Cmn
|
FloatingToolbarExitDirection |
The possible directions for a |
Cmn
|
FloatingToolbarHorizontalFabPosition |
The possible positions for a |
Cmn
|
FloatingToolbarVerticalFabPosition |
The possible positions for a |
Cmn
|
IconButtonColors |
Represents the container and content colors used in an icon button in different states. |
Cmn
|
IconButtonDefaults.IconButtonWidthOption |
Class that describes the different supported widths of the |
Cmn
|
IconButtonShapes |
The shapes that will be used in icon buttons. |
Cmn
|
IconToggleButtonColors |
Represents the container and content colors used in a toggleable icon button in different states. |
Cmn
|
IconToggleButtonShapes |
The shapes that will be used in toggle buttons. |
Cmn
|
ListItemColors |
Represents the colors of a list item in different states. |
Cmn
|
ListItemElevation |
Represents the elevation of a list item in different states. |
Cmn
|
ListItemShapes |
Represents the shapes of a list item in different states. |
Cmn
|
MaterialShapes |
Holds predefined Material Design shapes as |
Cmn
|
MaterialTheme.Values |
Material 3 contains different theme subsystems to allow visual customization across a UI hierarchy. |
Cmn
|
MenuAnchorPosition |
Class that determines the position of a menu relative to its anchor. |
Cmn
|
MenuGroupShapes |
Represents the shapes used for a |
Cmn
|
MenuItemColors |
Represents the text and icon colors used in a menu item at different states. |
Cmn
|
MenuItemShapes |
Represents the shapes used for a |
Cmn
|
ModalBottomSheetProperties |
Properties used to customize the behavior of a |
Cmn
android
|
ModalWideNavigationRailProperties |
Properties used to customize the behavior of a |
Cmn
android
|
NavigationBarItemColors |
Represents the colors of the various elements of a navigation item. |
Cmn
|
NavigationItemColors |
Represents the colors of the various elements of a navigation item. |
Cmn
|
NavigationItemIconPosition |
Class that describes the different supported icon positions of the navigation item. |
Cmn
|
NavigationRailItemColors |
Represents the colors of the various elements of a navigation item. |
Cmn
|
RadioButtonColors |
Represents the color used by a |
Cmn
|
RangeSliderState |
Class that holds information about |
Cmn
|
RichTooltipColors |
Cmn
|
|
RippleConfiguration |
Local per-ripple configuration for the |
Cmn
|
RippleConfiguration.Focus |
The configuration options for the focus indication for |
Cmn
|
RippleConfiguration.Focus.InsetRing |
An inset ring focus indication. |
Cmn
|
RippleConfiguration.Focus.Opacity |
An opacity-based focus indication. |
Cmn
|
RippleThemeConfiguration |
The overall ripple theme in use by all built-in components and |
Cmn
|
RippleThemeConfiguration.Focus |
The configuration options for the focus indication for |
Cmn
|
RippleThemeConfiguration.Focus.InsetRing |
An inset ring focus indication. |
Cmn
|
RippleThemeConfiguration.Focus.Opacity |
An opacity-based focus indication. |
Cmn
|
ScrollFieldColors |
Represents the colors used by a |
Cmn
|
ScrollFieldState |
A state object that can be hoisted to observe and control the scrolling behavior of a |
Cmn
|
SearchBarColors |
Represents the colors used by a search bar. |
Cmn
|
SearchBarState |
The state of a search bar. |
Cmn
|
SegmentedButtonColors |
The different colors used in parts of the |
Cmn
|
SelectableChipColors |
Represents the container and content colors used in a selectable chip in different states. |
Cmn
|
SelectableChipElevation |
Represents the elevation used in a selectable chip in different states. |
Cmn
|
Shapes |
Material surfaces can be displayed in different shapes. |
Cmn
|
SheetState |
State of a sheet composable, such as |
Cmn
|
ShortNavigationBarArrangement |
Class that describes the different supported item arrangements of the |
Cmn
|
SliderColors |
Represents the color used by a |
Cmn
|
SliderPositions |
This class is deprecated. Not necessary with the introduction of Slider state |
Cmn
|
SliderState |
Class that holds information about |
Cmn
|
SnackbarHostState |
State of the |
Cmn
|
SplitButtonShapes |
The shapes that will be used in |
Cmn
|
SwipeToDismissBoxState |
State of the |
Cmn
|
SwitchColors |
Represents the colors used by a |
Cmn
|
TabPosition |
Data class that contains information about a tab's position on screen, used for calculating where to place the indicator that shows which tab is selected. |
Cmn
|
TextFieldColors |
Represents the colors of the input text, container, and content (including label, placeholder, leading and trailing icons) used in a text field in different states. |
Cmn
|
TextFieldLabelPosition |
The position of the label with respect to the text field. |
Cmn
|
TextFieldLabelPosition.Above |
The label is positioned above and outside the text field container. |
Cmn
|
TextFieldLabelPosition.Attached |
This class is deprecated. Use Inside for the default filled TextField behavior, or Cutout for the default OutlinedTextField behavior. |
Cmn
|
TextFieldLabelPosition.Cutout |
The label is positioned inside the text field container when expanded and cuts into the border when minimized. |
Cmn
|
TextFieldLabelPosition.Inside |
The label is positioned inside the text field container. |
Cmn
|
TimePickerColors |
Represents the colors used by a |
Cmn
|
TimePickerDisplayMode |
Represents the display mode for the content of a |
Cmn
|
TimePickerLayoutType |
Represents the different configurations for the layout of the Time Picker |
Cmn
|
TimePickerSelectionMode |
The selection mode for the time picker |
Cmn
|
TimePickerShapes |
The shapes that will be used in time pickers. |
Cmn
|
ToggleButtonColors |
Represents the container and content colors used in a toggle button in different states. |
Cmn
|
ToggleButtonShapes |
The shapes that will be used in toggle buttons. |
Cmn
|
TooltipAnchorPosition |
Cmn
|
|
TopAppBarColors |
Represents the colors used by a top app bar in different states. |
Cmn
|
TopAppBarState |
A state object that can be hoisted to control and observe the top app bar state. |
Cmn
|
Typography |
The Material Design type scale includes a range of contrasting styles that support the needs of your product and its content. |
Cmn
|
WideNavigationRailColors |
Represents the colors of the various elements of a wide navigation rail. |
Cmn
|
Objects
AlertDialogDefaults |
Contains default values used for |
Cmn
|
AssistChipDefaults |
Contains the baseline values used by |
Cmn
|
BadgeDefaults |
Default values used for |
Cmn
|
BottomAppBarDefaults |
Contains default values used for the bottom app bar implementations. |
Cmn
|
BottomSheetDefaults |
Contains the default values used by |
Cmn
|
ButtonDefaults |
Contains the default values used by all 5 button types. |
Cmn
|
ButtonGroupDefaults |
Default values used by |
Cmn
|
CardDefaults |
Contains the default values used by all card types. |
Cmn
|
CheckboxDefaults |
Defaults used in |
Cmn
|
ComposeMaterial3Flags |
The object holding the feature flags. |
Cmn
|
DatePickerDefaults |
Contains default values used by the |
Cmn
|
DateRangePickerDefaults |
Contains default values used by the |
Cmn
|
DividerDefaults |
Default values for |
Cmn
|
DrawerDefaults |
Object to hold default values for |
Cmn
|
ExposedDropdownMenuDefaults |
Contains default values used by Exposed Dropdown Menu. |
Cmn
|
FilterChipDefaults |
Contains the baseline values used by |
Cmn
|
FloatingActionButtonDefaults |
Contains the default values used by |
Cmn
|
FloatingToolbarDefaults |
Contains default values used for the floating toolbar implementations. |
Cmn
|
IconButtonDefaults |
Contains the default values for all four icon and icon toggle button types. |
Cmn
|
InputChipDefaults |
Contains the baseline values used by an |
Cmn
|
ListItemDefaults |
Contains the default values used by list items. |
Cmn
|
LoadingIndicatorDefaults |
Contains default values by the |
Cmn
|
MaterialTheme |
Contains functions to access the current theme values provided at the call site's position in the hierarchy. |
Cmn
|
MenuDefaults |
Contains default values used for |
Cmn
|
ModalBottomSheetDefaults |
Default values for |
Cmn
android
|
NavigationBarDefaults |
Defaults used in |
Cmn
|
NavigationBarItemDefaults |
Defaults used in |
Cmn
|
NavigationDrawerItemDefaults |
Defaults used in |
Cmn
|
NavigationRailDefaults |
Defaults used in |
Cmn
|
NavigationRailItemDefaults |
Defaults used in |
Cmn
|
NonInteractiveScrollbarDefaults |
Contains the default values used by |
Cmn
|
OutlinedTextFieldDefaults |
Contains the default values used by |
Cmn
|
ProgressIndicatorDefaults |
Contains the default values used for |
Cmn
|
RadioButtonDefaults |
Defaults used in |
Cmn
|
RippleDefaults |
Default values used by |
Cmn
|
ScaffoldDefaults |
Object containing various default values for |
Cmn
|
ScrimDefaults |
Object containing default values for the |
Cmn
|
ScrollFieldDefaults |
Object to hold defaults used by |
Cmn
|
SearchBarDefaults |
Defaults used in |
Cmn
|
SegmentedButtonDefaults |
Cmn
|
|
ShapeDefaults |
Contains the default values used by |
Cmn
|
ShortNavigationBarDefaults |
Defaults used in |
Cmn
|
ShortNavigationBarItemDefaults |
Defaults used in |
Cmn
|
SliderDefaults |
Object to hold defaults used by |
Cmn
|
SnackbarDefaults |
Contains the default values used for |
Cmn
|
SplitButtonDefaults |
Contains default values used by |
Cmn
|
SuggestionChipDefaults |
Contains the baseline values used by |
Cmn
|
SwipeToDismissBoxDefaults |
Contains default values for |
Cmn
|
SwitchDefaults |
Contains the default values used by |
Cmn
|
TabRowDefaults |
Contains default implementations and values used for TabRow. |
Cmn
|
TextFieldDefaults |
Contains the default values used by |
Cmn
|
TimePickerDefaults |
Contains the default values used by |
Cmn
|
TimePickerDialogDefaults |
Default properties for a |
Cmn
|
ToggleButtonDefaults |
Contains the default values for all five toggle button types. |
Cmn
|
ToggleFloatingActionButtonDefaults |
Contains the default values used by |
Cmn
|
TooltipDefaults |
Tooltip defaults that contain default values for both |
Cmn
|
TopAppBarDefaults |
Contains default values used for the top app bar implementations. |
Cmn
|
VerticalDragHandleDefaults |
Contains the baseline values used by a |
Cmn
|
WavyProgressIndicatorDefaults |
Contains the default values used for wavy progress indicators |
Cmn
|
WideNavigationRailDefaults |
Defaults used in |
Cmn
|
WideNavigationRailItemDefaults |
Defaults used in |
Cmn
|
Annotations
Enums
DrawerValue |
Possible values of |
Cmn
|
SearchBarValue |
Possible values of |
Cmn
|
SheetValue |
Possible values of |
Cmn
|
SnackbarDuration |
Possible durations of the |
Cmn
|
SnackbarResult |
Possible results of the |
Cmn
|
SwipeToDismissBoxValue |
The directions in which a |
Cmn
|
WideNavigationRailValue |
Possible values of |
Cmn
|
Composables
AlertDialog |
Cmn
android
|
|
AppBarColumn |
An |
Cmn
|
AppBarOverflowIndicator |
Default overflow indicator for an |
Cmn
|
AppBarRow |
An |
Cmn
|
AppBarWithSearch |
Cmn
|
|
AssistChip |
Cmn
|
|
Badge |
A badge represents dynamic information such as a number of pending requests in a navigation bar. |
Cmn
|
BadgedBox |
Material Design badge box. |
Cmn
|
BasicAlertDialog |
Cmn
|
|
BottomAppBar |
Cmn
|
|
BottomSheet |
Cmn
|
|
BottomSheetScaffold |
Cmn
|
|
Button |
Cmn
|
|
ButtonGroup |
A layout composable that places its children in a horizontal sequence. |
Cmn
|
Card |
Cmn
|
|
CenterAlignedTopAppBar |
Cmn
|
|
Checkbox |
Cmn
|
|
CircularProgressIndicator |
Cmn
|
|
CircularWavyProgressIndicator |
Cmn
|
|
ContainedLoadingIndicator |
A Material Design contained loading indicator. |
Cmn
|
DatePicker |
Cmn
|
|
DatePickerDialog |
Cmn
android
|
|
DateRangePicker |
Cmn
|
|
DismissibleDrawerSheet |
Content inside of a dismissible navigation drawer. |
Cmn
|
DismissibleNavigationDrawer |
Cmn
|
|
Divider |
Cmn
|
|
DockedSearchBar |
Cmn
|
|
DropdownMenu |
Cmn
android
|
|
DropdownMenuGroup |
Cmn
|
|
DropdownMenuItem |
Cmn
android
|
|
DropdownMenuPopup |
Cmn
|
|
ElevatedAssistChip |
Cmn
|
|
ElevatedButton |
Cmn
|
|
ElevatedCard |
Cmn
|
|
ElevatedFilterChip |
Cmn
|
|
ElevatedSuggestionChip |
Cmn
|
|
ElevatedToggleButton |
Cmn
|
|
ExpandedDockedSearchBar |
|
Cmn
|
ExpandedDockedSearchBarWithGap |
|
Cmn
|
ExpandedFullScreenContainedSearchBar |
|
Cmn
|
ExpandedFullScreenSearchBar |
|
Cmn
|
ExposedDropdownMenuBox |
Cmn
|
|
ExtendedFloatingActionButton |
Cmn
|
|
FilledIconButton |
Cmn
|
|
FilledIconToggleButton |
Cmn
|
|
FilledTonalButton |
Cmn
|
|
FilledTonalIconButton |
Cmn
|
|
FilledTonalIconToggleButton |
Cmn
|
|
FilledTonalToggleButton |
Cmn
|
|
FilterChip |
Cmn
|
|
FlexibleBottomAppBar |
Cmn
|
|
FloatingActionButton |
Cmn
|
|
FloatingActionButtonMenu |
FAB Menus should be used in conjunction with a |
Cmn
|
FloatingActionButtonMenuItem |
FAB Menu Items should be used within a |
Cmn
|
HorizontalDivider |
Cmn
|
|
HorizontalFloatingToolbar |
A horizontal floating toolbar displays navigation and key actions in a |
Cmn
|
Icon |
A Material Design icon component that draws |
Cmn
|
IconButton |
Cmn
|
|
IconToggleButton |
Cmn
|
|
InputChip |
Cmn
|
|
Label |
Cmn
|
|
LargeExtendedFloatingActionButton |
Cmn
|
|
LargeFlexibleTopAppBar |
Cmn
|
|
LargeFloatingActionButton |
Cmn
|
|
LargeTopAppBar |
Cmn
|
|
LeadingIconTab |
Cmn
|
|
LinearProgressIndicator |
Cmn
|
|
LinearWavyProgressIndicator |
Material Design indeterminate linear wavy progress indicator |
Cmn
|
ListItem |
Cmn
|
|
LoadingIndicator |
A Material Design loading indicator. |
Cmn
|
MaterialExpressiveTheme |
Material Expressive Theming refers to the customization of your Material Design app to better reflect your product’s brand. |
Cmn
|
MaterialTheme |
Material Theming refers to the customization of your Material Design app to better reflect your product’s brand. |
Cmn
|
MediumExtendedFloatingActionButton |
Cmn
|
|
MediumFlexibleTopAppBar |
Cmn
|
|
MediumFloatingActionButton |
Cmn
|
|
MediumTopAppBar |
Cmn
|
|
ModalBottomSheet |
Cmn
|
|
ModalDrawerSheet |
Content inside of a modal navigation drawer. |
Cmn
|
ModalNavigationDrawer |
Cmn
|
|
ModalWideNavigationRail |
Material design modal wide navigation rail. |
Cmn
|
MultiChoiceSegmentedButtonRow |
Cmn
|
|
NavigationBar |
Cmn
|
|
NavigationBarItem |
Material Design navigation bar item. |
Cmn
|
NavigationDrawerItem |
Material Design navigation drawer item. |
Cmn
|
NavigationRail |
Cmn
|
|
NavigationRailItem |
Material Design navigation rail item. |
Cmn
|
OutlinedButton |
Cmn
|
|
OutlinedCard |
Cmn
|
|
OutlinedIconButton |
Cmn
|
|
OutlinedIconToggleButton |
Cmn
|
|
OutlinedSecureTextField |
Cmn
|
|
OutlinedTextField |
Cmn
|
|
OutlinedToggleButton |
Cmn
|
|
PermanentDrawerSheet |
Content inside of a permanent navigation drawer. |
Cmn
|
PermanentNavigationDrawer |
Cmn
|
|
PlainTooltip |
Plain tooltip that provides a descriptive message. |
Cmn
|
PrimaryScrollableTabRow |
Cmn
|
|
PrimaryTabRow |
Cmn
|
|
ProvideTextStyle |
This function is used to set the current value of |
Cmn
|
RadioButton |
Cmn
|
|
RangeSlider |
Cmn
|
|
RichTimePickerDialog |
Cmn
|
|
RichTooltip |
Rich text tooltip that allows the user to pass in a title, text, and action. |
Cmn
|
Scaffold |
Cmn
|
|
Scrim |
A Scrim that obscures content behind a modal surface. |
Cmn
|
ScrollField |
ScrollField's can be used to provide a more interactive way to select a time or other numerical value. |
Cmn
|
ScrollableTabRow |
Cmn
|
|
SearchBar |
Cmn
|
|
SecondaryScrollableTabRow |
Cmn
|
|
SecondaryTabRow |
Cmn
|
|
SecureTextField |
Cmn
|
|
SegmentedButton |
Cmn
|
|
SegmentedListItem |
Cmn
|
|
ShortNavigationBar |
Material Design short navigation bar. |
Cmn
|
ShortNavigationBarItem |
Material Design short navigation bar item. |
Cmn
|
SingleChoiceSegmentedButtonRow |
Cmn
|
|
Slider |
Cmn
|
|
SmallExtendedFloatingActionButton |
Cmn
|
|
SmallFloatingActionButton |
Cmn
|
|
Snackbar |
Cmn
|
|
SnackbarHost |
Host for |
Cmn
|
SplitButton |
A |
Cmn
|
SplitButtonLayout |
A |
Cmn
|
SuggestionChip |
Cmn
|
|
Surface |
Material surface is the central metaphor in material design. |
Cmn
|
SwipeToDismissBox |
A composable that can be dismissed by swiping left or right. |
Cmn
|
Switch |
Cmn
|
|
Tab |
Cmn
|
|
TabRow |
Cmn
|
|
Text |
High level element that displays text and provides semantics / accessibility information. |
Cmn
|
TextButton |
Cmn
|
|
TextField |
Cmn
|
|
TimeInput |
Time pickers help users select and set a specific time. |
Cmn
|
TimePicker |
Cmn
|
|
TimePickerDialog |
Cmn
|
|
TimeScroll |
Time pickers help users select and set a specific time. |
Cmn
|
ToggleButton |
Cmn
|
|
ToggleFloatingActionButton |
Toggleable FAB supports animating its container size, corner radius, and color when it is toggled, and should be used in conjunction with a |
Cmn
|
TonalToggleButton |
Cmn
|
|
TooltipBox |
Material TooltipBox that wraps a composable with a tooltip. |
Cmn
|
TopAppBar |
Cmn
|
|
TopSearchBar |
Cmn
|
|
TriStateCheckbox |
Cmn
|
|
TwoRowsTopAppBar |
A basic two-rows Material Design top app bar. |
Cmn
|
VerticalDivider |
Cmn
|
|
VerticalDragHandle |
Cmn
|
|
VerticalFloatingToolbar |
A vertical floating toolbar displays navigation and key actions in a |
Cmn
|
VerticalSlider |
Cmn
|
|
WideNavigationRail |
Material design wide navigation rail. |
Cmn
|
WideNavigationRailItem |
Material Design wide navigation rail item. |
Cmn
|
contentColorFor |
The Material color system contains pairs of colors that are typically used for the background and content color inside a component. |
Cmn
|
nonInteractiveScrollbar |
A visual-only scrollbar that represents the current scroll position of a scrolling component. |
Cmn
|
rememberBottomAppBarState |
Creates a |
Cmn
|
rememberBottomSheetScaffoldState |
Create and |
Cmn
|
rememberBottomSheetState |
Create and |
Cmn
|
rememberContainedSearchBarState |
Create and remember a |
Cmn
|
rememberDatePickerState |
Cmn
android
|
|
rememberDateRangePickerState |
Cmn
android
|
|
rememberDrawerState |
Create and |
Cmn
|
rememberFloatingToolbarState |
Creates a |
Cmn
|
rememberModalBottomSheetState |
Create and |
Cmn
|
rememberRangeSliderState |
Creates a |
Cmn
|
rememberScrollFieldState |
Creates and remembers a |
Cmn
|
rememberSearchBarState |
Create and remember a |
Cmn
|
rememberSearchBarWithGapState |
Create and remember a |
Cmn
|
rememberSliderState |
Creates a |
Cmn
|
rememberStandardBottomSheetState |
Create and |
Cmn
|
rememberSwipeToDismissBoxState |
Create and |
Cmn
|
rememberTimePickerState |
Creates a |
Cmn
|
rememberTooltipState |
Create and remember the default |
Cmn
|
rememberTopAppBarState |
Creates a |
Cmn
|
rememberWideNavigationRailState |
Create and |
Cmn
|
toPath |
Returns a |
Cmn
|
toShape |
Returns a |
Cmn
|
Modifiers
animateFloatingActionButton |
Apply this modifier to a |
Cmn
|
minimumInteractiveComponentSize |
Reserves at least 48.dp in size to disambiguate touch interactions if the element would measure smaller. |
Cmn
|
Type aliases
CalendarLocale |
Represents a Locale for the calendar. |
android
|
MenuAnchorType |
This type alias is deprecated. Renamed to ExposedDropdownMenuAnchorType |
Cmn
|
Top-level functions summary
BottomAppBarState |
@ExperimentalMaterial3ApiCreates a |
Cmn
|
DatePickerState |
@RequiresApi(value = 26)Creates a |
android
|
DatePickerState |
DatePickerState(Creates a |
Cmn
|
DateRangePickerState |
@RequiresApi(value = 26)Creates a |
android
|
DateRangePickerState |
DateRangePickerState(Creates a |
Cmn
|
FloatingToolbarState |
FloatingToolbarState(Creates a |
Cmn
|
TimePickerState |
TimePickerState(initialHour: Int, initialMinute: Int, is24Hour: Boolean)Factory function for the default implementation of |
Cmn
|
TooltipState |
@ExperimentalMaterial3ApiConstructor extension function for |
Cmn
|
ColorScheme |
darkColorScheme(Returns a dark Material color scheme. |
Cmn
|
ColorScheme |
@RequiresApi(value = 31)Creates a dark dynamic color scheme. |
android
|
ColorScheme |
@RequiresApi(value = 31)Creates a light dynamic color scheme. |
android
|
ColorScheme |
Returns a light Material color scheme. |
Cmn
|
ColorScheme |
lightColorScheme(Returns a light Material color scheme. |
Cmn
|
IndicationNodeFactory |
ripple(Creates a Ripple using the provided values and values inferred from the theme. |
Cmn
|
IndicationNodeFactory |
ripple(Creates a Ripple using the provided values and values inferred from the theme. |
Cmn
|
Extension functions summary
Color |
ColorScheme.contentColorFor(backgroundColor: Color)The Material color system contains pairs of colors that are typically used for the background and content color inside a component. |
Cmn
|
YearMonth |
@RequiresApi(value = 26)Returns a |
android
|
YearMonth |
@RequiresApi(value = 26)Returns a |
android
|
LocalDate? |
@RequiresApi(value = 26)Returns a |
android
|
LocalDate? |
@RequiresApi(value = 26)Returns a |
android
|
LocalDate? |
@RequiresApi(value = 26)Returns a |
android
|
Unit |
@RequiresApi(value = 26)Sets the |
android
|
Unit |
@RequiresApi(value = 26)Sets the |
android
|
Unit |
@RequiresApi(value = 26)Sets the |
android
|
Unit |
@RequiresApi(value = 26)Sets the |
android
|
Color |
ColorScheme.surfaceColorAtElevation(elevation: Dp)Computes the surface tonal color at different elevation levels e.g. surface1 through surface5. |
Cmn
|
Path |
Cmn
|
Top-level properties summary
ProvidableCompositionLocal<Dp> |
CompositionLocal containing the current absolute elevation provided by |
Cmn
|
ProvidableCompositionLocal<Color> |
CompositionLocal containing the preferred content color for a given position in the hierarchy. |
Cmn
|
ProvidableCompositionLocal<Boolean> |
This property is deprecated. Use LocalMinimumInteractiveComponentSize with 0.dp to turn off enforcement instead. |
Cmn
|
ProvidableCompositionLocal<Dp> |
CompositionLocal that configures the minimum touch target size for Material components (such as |
Cmn
|
ProvidableCompositionLocal<RippleConfiguration?> |
CompositionLocal used for providing |
Cmn
|
ProvidableCompositionLocal<RippleThemeConfiguration> |
The overall |
Cmn
|
ProvidableCompositionLocal<TextStyle> |
CompositionLocal containing the preferred |
Cmn
|
ProvidableCompositionLocal<Boolean> |
Composition Local used to check if |
Cmn
|
VerticalAlignmentLine |
The vertical |
Cmn
|
HorizontalAlignmentLine |
The horizontal |
Cmn
|
Extension properties summary
Boolean |
|
Cmn
|
Boolean |
|
Cmn
|
Boolean |
|
Cmn
|
Boolean |
Indicates whether the selected time falls within the period from 12 PM inclusive to 12 AM non inclusive. |
Cmn
|
Top-level functions
BottomAppBarState
@ExperimentalMaterial3Api
fun BottomAppBarState(
initialHeightOffsetLimit: Float,
initialHeightOffset: Float,
initialContentOffset: Float
): BottomAppBarState
Creates a BottomAppBarState.
| Parameters | |
|---|---|
initialHeightOffsetLimit: Float |
the initial value for |
initialHeightOffset: Float |
the initial value for |
initialContentOffset: Float |
the initial value for |
DatePickerState
@RequiresApi(value = 26)
fun DatePickerState(
locale: Locale,
initialSelectedDate: LocalDate?,
initialDisplayedMonth: YearMonth? = initialSelectedDate?.let { YearMonth.from(it) },
yearRange: IntRange = DatePickerDefaults.YearRange,
initialDisplayMode: DisplayMode = DisplayMode.Picker,
selectableDates: SelectableDates = DatePickerDefaults.AllDates
): DatePickerState
Creates a DatePickerState.
For most cases, you are advised to use the rememberDatePickerState when in a composition.
The initial values are converted to UTC milliseconds at the start of the day (midnight):
-
initialSelectedDateis used to setDatePickerState.selectedDateMillis. -
initialDisplayedMonthis used to setDatePickerState.displayedMonthMillis, based on the first day of that month.
Note that in case you provide a locale that is different than the default platform locale, you may need to ensure that the picker's title and headline are localized correctly. The following sample shows one possible way of doing so by applying a local composition of a LocalContext and LocaleConfiguration.
import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.padding import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.verticalScroll import androidx.compose.material3.DatePicker import androidx.compose.material3.DatePickerState import androidx.compose.material3.Text import androidx.compose.material3.getSelectedDate import androidx.compose.material3.rememberDatePickerState import androidx.compose.runtime.CompositionLocalProvider import androidx.compose.runtime.remember import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalConfiguration import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalLayoutDirection import androidx.compose.ui.unit.LayoutDirection import androidx.compose.ui.unit.dp val preferredLocales = LocaleList.forLanguageTags("HE") val config = Configuration() config.setLocales(preferredLocales) val newContext = LocalContext.current.createConfigurationContext(config) CompositionLocalProvider( LocalContext provides newContext, LocalConfiguration provides config, LocalLayoutDirection provides LayoutDirection.Rtl, ) { Column( modifier = Modifier.verticalScroll(rememberScrollState()), verticalArrangement = Arrangement.spacedBy(8.dp), ) { // Pre-select a date for January 4, 2020 // Initialize date picker with the preferred locale. Here we create a state directly, // but since the Locale was set at the CompositionLocalProvider through a Configuration, // a `val datePickerState = rememberDatePickerState(...)` will have the same effect. val datePickerState = remember { DatePickerState( initialSelectedDate = LocalDate.of(2020, 1, 4), // Set to "HE" locale. locale = preferredLocales.get(0), ) } DatePicker(state = datePickerState, modifier = Modifier.padding(16.dp)) Text( "Selected date: ${datePickerState.getSelectedDate() ?: "no selection"}", modifier = Modifier.align(Alignment.CenterHorizontally), ) } }
| Parameters | |
|---|---|
locale: Locale |
the |
initialSelectedDate: LocalDate? |
a |
initialDisplayedMonth: YearMonth? = initialSelectedDate?.let { YearMonth.from(it) } |
an optional |
yearRange: IntRange = DatePickerDefaults.YearRange |
an |
initialDisplayMode: DisplayMode = DisplayMode.Picker |
an initial |
selectableDates: SelectableDates = DatePickerDefaults.AllDates |
a |
| Throws | |
|---|---|
IllegalArgumentException |
if the initial selected date or displayed month represent a year that is out of the year range. |
| See also | |
|---|---|
rememberDatePickerState |
DatePickerState
fun DatePickerState(
locale: CalendarLocale,
initialSelectedDateMillis: Long? = null,
initialDisplayedMonthMillis: Long? = initialSelectedDateMillis,
yearRange: IntRange = DatePickerDefaults.YearRange,
initialDisplayMode: DisplayMode = DisplayMode.Picker,
selectableDates: SelectableDates = DatePickerDefaults.AllDates
): DatePickerState
Creates a DatePickerState.
For most cases, you are advised to use the rememberDatePickerState when in a composition.
Note that in case you provide a locale that is different than the default platform locale, you may need to ensure that the picker's title and headline are localized correctly. The following sample shows one possible way of doing so by applying a local composition of a LocalContext and LocaleConfiguration.
import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.padding import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.verticalScroll import androidx.compose.material3.DatePicker import androidx.compose.material3.DatePickerState import androidx.compose.material3.Text import androidx.compose.material3.rememberDatePickerState import androidx.compose.runtime.CompositionLocalProvider import androidx.compose.runtime.remember import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalConfiguration import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalLayoutDirection import androidx.compose.ui.unit.LayoutDirection import androidx.compose.ui.unit.dp val preferredLocales = LocaleList.forLanguageTags("HE") val config = Configuration() config.setLocales(preferredLocales) val newContext = LocalContext.current.createConfigurationContext(config) CompositionLocalProvider( LocalContext provides newContext, LocalConfiguration provides config, LocalLayoutDirection provides LayoutDirection.Rtl, ) { Column( modifier = Modifier.verticalScroll(rememberScrollState()), verticalArrangement = Arrangement.spacedBy(8.dp), ) { // Pre-select a date for January 4, 2020 // Initialize date picker with the preferred locale. Here we create a state directly, // but since the Locale was set at the CompositionLocalProvider through a Configuration, // a `val datePickerState = rememberDatePickerState(...)` will have the same effect. val datePickerState = remember { DatePickerState( initialSelectedDateMillis = 1578096000000, // Set to "HE" locale. locale = preferredLocales.get(0), ) } DatePicker(state = datePickerState, modifier = Modifier.padding(16.dp)) Text( "Selected date timestamp: ${datePickerState.selectedDateMillis ?: "no selection"}", modifier = Modifier.align(Alignment.CenterHorizontally), ) } }
| Parameters | |
|---|---|
locale: CalendarLocale |
the |
initialSelectedDateMillis: Long? = null |
timestamp in UTC milliseconds from the epoch that represents an initial selection of a date. Provide a |
initialDisplayedMonthMillis: Long? = initialSelectedDateMillis |
timestamp in UTC milliseconds from the epoch that represents an initial selection of a month to be displayed to the user. In case |
yearRange: IntRange = DatePickerDefaults.YearRange |
an |
initialDisplayMode: DisplayMode = DisplayMode.Picker |
an initial |
selectableDates: SelectableDates = DatePickerDefaults.AllDates |
a |
| Throws | |
|---|---|
IllegalArgumentException |
if the initial selected date or displayed month represent a year that is out of the year range. |
| See also | |
|---|---|
rememberDatePickerState |
DateRangePickerState
@RequiresApi(value = 26)
fun DateRangePickerState(
locale: Locale,
initialSelectedStartDate: LocalDate?,
initialSelectedEndDate: LocalDate?,
initialDisplayedMonth: YearMonth? = initialSelectedStartDate?.let { YearMonth.from(it) },
yearRange: IntRange = DatePickerDefaults.YearRange,
initialDisplayMode: DisplayMode = DisplayMode.Picker,
selectableDates: SelectableDates = DatePickerDefaults.AllDates
): DateRangePickerState
Creates a DateRangePickerState.
For most cases, you are advised to use the rememberDateRangePickerState when in a composition.
The initial values are converted to UTC milliseconds at the start of the day (midnight):
-
initialSelectedStartDateis used to setDateRangePickerState.selectedStartDateMillis. -
initialSelectedEndDateis used to setDateRangePickerState.selectedEndDateMillis. -
initialDisplayedMonthis used to setDateRangePickerState.displayedMonthMillis, based on the first day of that month.
Note that in case you provide a locale that is different than the default platform locale, you may need to ensure that the picker's title and headline are localized correctly. The following sample shows one possible way of doing so by applying a local composition of a LocalContext and LocaleConfiguration.
import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.padding import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.verticalScroll import androidx.compose.material3.DatePicker import androidx.compose.material3.DatePickerState import androidx.compose.material3.Text import androidx.compose.material3.getSelectedDate import androidx.compose.material3.rememberDatePickerState import androidx.compose.runtime.CompositionLocalProvider import androidx.compose.runtime.remember import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalConfiguration import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalLayoutDirection import androidx.compose.ui.unit.LayoutDirection import androidx.compose.ui.unit.dp val preferredLocales = LocaleList.forLanguageTags("HE") val config = Configuration() config.setLocales(preferredLocales) val newContext = LocalContext.current.createConfigurationContext(config) CompositionLocalProvider( LocalContext provides newContext, LocalConfiguration provides config, LocalLayoutDirection provides LayoutDirection.Rtl, ) { Column( modifier = Modifier.verticalScroll(rememberScrollState()), verticalArrangement = Arrangement.spacedBy(8.dp), ) { // Pre-select a date for January 4, 2020 // Initialize date picker with the preferred locale. Here we create a state directly, // but since the Locale was set at the CompositionLocalProvider through a Configuration, // a `val datePickerState = rememberDatePickerState(...)` will have the same effect. val datePickerState = remember { DatePickerState( initialSelectedDate = LocalDate.of(2020, 1, 4), // Set to "HE" locale. locale = preferredLocales.get(0), ) } DatePicker(state = datePickerState, modifier = Modifier.padding(16.dp)) Text( "Selected date: ${datePickerState.getSelectedDate() ?: "no selection"}", modifier = Modifier.align(Alignment.CenterHorizontally), ) } }
| Parameters | |
|---|---|
locale: Locale |
the |
initialSelectedStartDate: LocalDate? |
a |
initialSelectedEndDate: LocalDate? |
a |
initialDisplayedMonth: YearMonth? = initialSelectedStartDate?.let { YearMonth.from(it) } |
an optional |
yearRange: IntRange = DatePickerDefaults.YearRange |
an |
initialDisplayMode: DisplayMode = DisplayMode.Picker |
an initial |
selectableDates: SelectableDates = DatePickerDefaults.AllDates |
a |
| Throws | |
|---|---|
IllegalArgumentException |
if the initial timestamps do not fall within the year range this state is created with, or the end date precedes the start date, or when an end date is provided without a start date (e.g. the start date was null, while the end date was not). |
| See also | |
|---|---|
rememberDateRangePickerState |
DateRangePickerState
fun DateRangePickerState(
locale: CalendarLocale,
initialSelectedStartDateMillis: Long? = null,
initialSelectedEndDateMillis: Long? = null,
initialDisplayedMonthMillis: Long? = initialSelectedStartDateMillis,
yearRange: IntRange = DatePickerDefaults.YearRange,
initialDisplayMode: DisplayMode = DisplayMode.Picker,
selectableDates: SelectableDates = DatePickerDefaults.AllDates
): DateRangePickerState
Creates a DateRangePickerState.
For most cases, you are advised to use the rememberDateRangePickerState when in a composition.
Note that in case you provide a locale that is different than the default platform locale, you may need to ensure that the picker's title and headline are localized correctly. The following sample shows one possible way of doing so by applying a local composition of a LocalContext and LocaleConfiguration.
import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.padding import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.verticalScroll import androidx.compose.material3.DatePicker import androidx.compose.material3.DatePickerState import androidx.compose.material3.Text import androidx.compose.material3.rememberDatePickerState import androidx.compose.runtime.CompositionLocalProvider import androidx.compose.runtime.remember import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalConfiguration import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalLayoutDirection import androidx.compose.ui.unit.LayoutDirection import androidx.compose.ui.unit.dp val preferredLocales = LocaleList.forLanguageTags("HE") val config = Configuration() config.setLocales(preferredLocales) val newContext = LocalContext.current.createConfigurationContext(config) CompositionLocalProvider( LocalContext provides newContext, LocalConfiguration provides config, LocalLayoutDirection provides LayoutDirection.Rtl, ) { Column( modifier = Modifier.verticalScroll(rememberScrollState()), verticalArrangement = Arrangement.spacedBy(8.dp), ) { // Pre-select a date for January 4, 2020 // Initialize date picker with the preferred locale. Here we create a state directly, // but since the Locale was set at the CompositionLocalProvider through a Configuration, // a `val datePickerState = rememberDatePickerState(...)` will have the same effect. val datePickerState = remember { DatePickerState( initialSelectedDateMillis = 1578096000000, // Set to "HE" locale. locale = preferredLocales.get(0), ) } DatePicker(state = datePickerState, modifier = Modifier.padding(16.dp)) Text( "Selected date timestamp: ${datePickerState.selectedDateMillis ?: "no selection"}", modifier = Modifier.align(Alignment.CenterHorizontally), ) } }
| Parameters | |
|---|---|
locale: CalendarLocale |
the |
initialSelectedStartDateMillis: Long? = null |
timestamp in UTC milliseconds from the epoch that represents an initial selection of a start date. Provide a |
initialSelectedEndDateMillis: Long? = null |
timestamp in UTC milliseconds from the epoch that represents an initial selection of an end date. Provide a |
initialDisplayedMonthMillis: Long? = initialSelectedStartDateMillis |
timestamp in UTC milliseconds from the epoch that represents an initial selection of a month to be displayed to the user. By default, in case an |
yearRange: IntRange = DatePickerDefaults.YearRange |
an |
initialDisplayMode: DisplayMode = DisplayMode.Picker |
an initial |
selectableDates: SelectableDates = DatePickerDefaults.AllDates |
a |
| Throws | |
|---|---|
IllegalArgumentException |
if the initial timestamps do not fall within the year range this state is created with, or the end date precedes the start date, or when an end date is provided without a start date (e.g. the start date was null, while the end date was not). |
| See also | |
|---|---|
rememberDateRangePickerState |
FloatingToolbarState
fun FloatingToolbarState(
initialOffsetLimit: Float,
initialOffset: Float,
initialContentOffset: Float
): FloatingToolbarState
Creates a FloatingToolbarState.
| Parameters | |
|---|---|
initialOffsetLimit: Float |
the initial value for |
initialOffset: Float |
the initial value for |
initialContentOffset: Float |
the initial value for |
TimePickerState
fun TimePickerState(initialHour: Int, initialMinute: Int, is24Hour: Boolean): TimePickerState
Factory function for the default implementation of TimePickerState should be used in most cases.
| Parameters | |
|---|---|
initialHour: Int |
starting hour for this state, will be displayed in the time picker when launched Ranges from 0 to 23 |
initialMinute: Int |
starting minute for this state, will be displayed in the time picker when launched. Ranges from 0 to 59 |
is24Hour: Boolean |
The format for this time picker. |
TooltipState
@ExperimentalMaterial3Api
fun TooltipState(
initialIsVisible: Boolean = false,
isPersistent: Boolean = true,
mutatorMutex: MutatorMutex = BasicTooltipDefaults.GlobalMutatorMutex
): TooltipState
Constructor extension function for TooltipState
| Parameters | |
|---|---|
initialIsVisible: Boolean = false |
the initial value for the tooltip's visibility when drawn. |
isPersistent: Boolean = true |
|
mutatorMutex: MutatorMutex = BasicTooltipDefaults.GlobalMutatorMutex |
|
darkColorScheme
fun darkColorScheme(
primary: Color = ColorDarkTokens.Primary,
onPrimary: Color = ColorDarkTokens.OnPrimary,
primaryContainer: Color = ColorDarkTokens.PrimaryContainer,
onPrimaryContainer: Color = ColorDarkTokens.OnPrimaryContainer,
inversePrimary: Color = ColorDarkTokens.InversePrimary,
secondary: Color = ColorDarkTokens.Secondary,
onSecondary: Color = ColorDarkTokens.OnSecondary,
secondaryContainer: Color = ColorDarkTokens.SecondaryContainer,
onSecondaryContainer: Color = ColorDarkTokens.OnSecondaryContainer,
tertiary: Color = ColorDarkTokens.Tertiary,
onTertiary: Color = ColorDarkTokens.OnTertiary,
tertiaryContainer: Color = ColorDarkTokens.TertiaryContainer,
onTertiaryContainer: Color = ColorDarkTokens.OnTertiaryContainer,
background: Color = ColorDarkTokens.Background,
onBackground: Color = ColorDarkTokens.OnBackground,
surface: Color = ColorDarkTokens.Surface,
onSurface: Color = ColorDarkTokens.OnSurface,
surfaceVariant: Color = ColorDarkTokens.SurfaceVariant,
onSurfaceVariant: Color = ColorDarkTokens.OnSurfaceVariant,
surfaceTint: Color = primary,
inverseSurface: Color = ColorDarkTokens.InverseSurface,
inverseOnSurface: Color = ColorDarkTokens.InverseOnSurface,
error: Color = ColorDarkTokens.Error,
onError: Color = ColorDarkTokens.OnError,
errorContainer: Color = ColorDarkTokens.ErrorContainer,
onErrorContainer: Color = ColorDarkTokens.OnErrorContainer,
outline: Color = ColorDarkTokens.Outline,
outlineVariant: Color = ColorDarkTokens.OutlineVariant,
scrim: Color = ColorDarkTokens.Scrim,
surfaceBright: Color = ColorDarkTokens.SurfaceBright,
surfaceContainer: Color = ColorDarkTokens.SurfaceContainer,
surfaceContainerHigh: Color = ColorDarkTokens.SurfaceContainerHigh,
surfaceContainerHighest: Color = ColorDarkTokens.SurfaceContainerHighest,
surfaceContainerLow: Color = ColorDarkTokens.SurfaceContainerLow,
surfaceContainerLowest: Color = ColorDarkTokens.SurfaceContainerLowest,
surfaceDim: Color = ColorDarkTokens.SurfaceDim,
primaryFixed: Color = ColorDarkTokens.PrimaryFixed,
primaryFixedDim: Color = ColorDarkTokens.PrimaryFixedDim,
onPrimaryFixed: Color = ColorDarkTokens.OnPrimaryFixed,
onPrimaryFixedVariant: Color = ColorDarkTokens.OnPrimaryFixedVariant,
secondaryFixed: Color = ColorDarkTokens.SecondaryFixed,
secondaryFixedDim: Color = ColorDarkTokens.SecondaryFixedDim,
onSecondaryFixed: Color = ColorDarkTokens.OnSecondaryFixed,
onSecondaryFixedVariant: Color = ColorDarkTokens.OnSecondaryFixedVariant,
tertiaryFixed: Color = ColorDarkTokens.TertiaryFixed,
tertiaryFixedDim: Color = ColorDarkTokens.TertiaryFixedDim,
onTertiaryFixed: Color = ColorDarkTokens.OnTertiaryFixed,
onTertiaryFixedVariant: Color = ColorDarkTokens.OnTertiaryFixedVariant
): ColorScheme
Returns a dark Material color scheme.
dynamicDarkColorScheme
@RequiresApi(value = 31)
fun dynamicDarkColorScheme(context: Context): ColorScheme
Creates a dark dynamic color scheme.
Use this function to create a color scheme based off the system wallpaper. If the developer changes the wallpaper this color scheme will change accordingly. This dynamic scheme is a dark theme variant.
| Parameters | |
|---|---|
context: Context |
The context required to get system resource data. |
dynamicLightColorScheme
@RequiresApi(value = 31)
fun dynamicLightColorScheme(context: Context): ColorScheme
Creates a light dynamic color scheme.
Use this function to create a color scheme based off the system wallpaper. If the developer changes the wallpaper this color scheme will change accordingly. This dynamic scheme is a light theme variant.
| Parameters | |
|---|---|
context: Context |
The context required to get system resource data. |
expressiveLightColorScheme
fun expressiveLightColorScheme(): ColorScheme
Returns a light Material color scheme.
The default color scheme for MaterialExpressiveTheme. For dark mode, use darkColorScheme.
Example of MaterialExpressiveTheme toggling expressiveLightColorScheme and darkTheme.
import androidx.compose.foundation.isSystemInDarkTheme import androidx.compose.material3.MaterialExpressiveTheme import androidx.compose.material3.darkColorScheme import androidx.compose.material3.expressiveLightColorScheme import androidx.compose.runtime.Composable @Composable fun MyMaterialTheme(content: @Composable () -> Unit) { MaterialExpressiveTheme( colorScheme = if (isSystemInDarkTheme()) darkColorScheme() else expressiveLightColorScheme() ) { content() } }
lightColorScheme
fun lightColorScheme(
primary: Color = ColorLightTokens.Primary,
onPrimary: Color = ColorLightTokens.OnPrimary,
primaryContainer: Color = ColorLightTokens.PrimaryContainer,
onPrimaryContainer: Color = ColorLightTokens.OnPrimaryContainer,
inversePrimary: Color = ColorLightTokens.InversePrimary,
secondary: Color = ColorLightTokens.Secondary,
onSecondary: Color = ColorLightTokens.OnSecondary,
secondaryContainer: Color = ColorLightTokens.SecondaryContainer,
onSecondaryContainer: Color = ColorLightTokens.OnSecondaryContainer,
tertiary: Color = ColorLightTokens.Tertiary,
onTertiary: Color = ColorLightTokens.OnTertiary,
tertiaryContainer: Color = ColorLightTokens.TertiaryContainer,
onTertiaryContainer: Color = ColorLightTokens.OnTertiaryContainer,
background: Color = ColorLightTokens.Background,
onBackground: Color = ColorLightTokens.OnBackground,
surface: Color = ColorLightTokens.Surface,
onSurface: Color = ColorLightTokens.OnSurface,
surfaceVariant: Color = ColorLightTokens.SurfaceVariant,
onSurfaceVariant: Color = ColorLightTokens.OnSurfaceVariant,
surfaceTint: Color = primary,
inverseSurface: Color = ColorLightTokens.InverseSurface,
inverseOnSurface: Color = ColorLightTokens.InverseOnSurface,
error: Color = ColorLightTokens.Error,
onError: Color = ColorLightTokens.OnError,
errorContainer: Color = ColorLightTokens.ErrorContainer,
onErrorContainer: Color = ColorLightTokens.OnErrorContainer,
outline: Color = ColorLightTokens.Outline,
outlineVariant: Color = ColorLightTokens.OutlineVariant,
scrim: Color = ColorLightTokens.Scrim,
surfaceBright: Color = ColorLightTokens.SurfaceBright,
surfaceContainer: Color = ColorLightTokens.SurfaceContainer,
surfaceContainerHigh: Color = ColorLightTokens.SurfaceContainerHigh,
surfaceContainerHighest: Color = ColorLightTokens.SurfaceContainerHighest,
surfaceContainerLow: Color = ColorLightTokens.SurfaceContainerLow,
surfaceContainerLowest: Color = ColorLightTokens.SurfaceContainerLowest,
surfaceDim: Color = ColorLightTokens.SurfaceDim,
primaryFixed: Color = ColorLightTokens.PrimaryFixed,
primaryFixedDim: Color = ColorLightTokens.PrimaryFixedDim,
onPrimaryFixed: Color = ColorLightTokens.OnPrimaryFixed,
onPrimaryFixedVariant: Color = ColorLightTokens.OnPrimaryFixedVariant,
secondaryFixed: Color = ColorLightTokens.SecondaryFixed,
secondaryFixedDim: Color = ColorLightTokens.SecondaryFixedDim,
onSecondaryFixed: Color = ColorLightTokens.OnSecondaryFixed,
onSecondaryFixedVariant: Color = ColorLightTokens.OnSecondaryFixedVariant,
tertiaryFixed: Color = ColorLightTokens.TertiaryFixed,
tertiaryFixedDim: Color = ColorLightTokens.TertiaryFixedDim,
onTertiaryFixed: Color = ColorLightTokens.OnTertiaryFixed,
onTertiaryFixedVariant: Color = ColorLightTokens.OnTertiaryFixedVariant
): ColorScheme
Returns a light Material color scheme.
ripple
fun ripple(
bounded: Boolean = true,
radius: Dp = Dp.Unspecified,
color: Color = Color.Unspecified,
focusRingShape: Shape? = null,
enablePressIndication: Boolean = true,
enableFocusIndication: Boolean = true,
enableHoverIndication: Boolean = true,
enableDragIndication: Boolean = true
): IndicationNodeFactory
Creates a Ripple using the provided values and values inferred from the theme.
A Ripple is a Material implementation of Indication that expresses different Interactions by drawing ripple animations and state layers.
A Ripple responds to PressInteraction.Press by starting a new ripple animation, and responds to other Interactions by showing a fixed state layer with varying alpha values depending on the Interaction.
MaterialTheme provides Ripples using androidx.compose.foundation.LocalIndication, so a Ripple will be used as the default Indication inside components such as androidx.compose.foundation.clickable and androidx.compose.foundation.indication, in addition to Material provided components that use a Ripple as well.
You can also explicitly create a Ripple and provide it to custom components in order to change the parameters from the default, such as to create an unbounded ripple with a fixed size.
To create a Ripple with a manually defined color that can change over time, see the other ripple overload with a ColorProducer parameter. This will avoid unnecessary recompositions when changing the color, and preserve existing ripple state when the color changes.
| Parameters | |
|---|---|
bounded: Boolean = true |
If true, ripples are clipped by the bounds of the target layout. Unbounded ripples always animate from the target layout center, bounded ripples animate from the touch position. |
radius: Dp = Dp.Unspecified |
the radius for the ripple. If |
color: Color = Color.Unspecified |
the color of the ripple state layers. This color is usually the same color used by the text or iconography in the component. This color will then have |
focusRingShape: Shape? = null |
if specified, the shape of the ripple that the focus ring indication will use, if inset focus ring indications are enabled. If left |
enablePressIndication: Boolean = true |
if true, this ripple will draw the indication for press interactions. Set this to |
enableFocusIndication: Boolean = true |
if true, this ripple will draw the indication for focus interactions. Set this to |
enableHoverIndication: Boolean = true |
if true, this ripple will draw the indication for hover interactions. Set this to |
enableDragIndication: Boolean = true |
if true, this ripple will draw the indication for drag interactions. Set this to |
ripple
fun ripple(
color: ColorProducer,
bounded: Boolean = true,
radius: Dp = Dp.Unspecified,
focusRingShape: Shape? = null,
enablePressIndication: Boolean = true,
enableFocusIndication: Boolean = true,
enableHoverIndication: Boolean = true,
enableDragIndication: Boolean = true
): IndicationNodeFactory
Creates a Ripple using the provided values and values inferred from the theme.
A Ripple is a Material implementation of Indication that expresses different Interactions by drawing ripple animations and state layers.
A Ripple responds to PressInteraction.Press by starting a new ripple animation, and responds to other Interactions by showing a fixed state layer with varying alpha values depending on the Interaction.
MaterialTheme provides Ripples using androidx.compose.foundation.LocalIndication, so a Ripple will be used as the default Indication inside components such as androidx.compose.foundation.clickable and androidx.compose.foundation.indication, in addition to Material provided components that use a Ripple as well.
You can also explicitly create a Ripple and provide it to custom components in order to change the parameters from the default, such as to create an unbounded ripple with a fixed size.
To create a Ripple with a static color, see the ripple overload with a Color parameter. This overload is optimized for Ripples that have dynamic colors that change over time, to reduce unnecessary recompositions.
| Parameters | |
|---|---|
color: ColorProducer |
the color of the ripple. This color is usually the same color used by the text or iconography in the component. This color will then have |
bounded: Boolean = true |
If true, ripples are clipped by the bounds of the target layout. Unbounded ripples always animate from the target layout center, bounded ripples animate from the touch position. |
radius: Dp = Dp.Unspecified |
the radius for the ripple. If |
focusRingShape: Shape? = null |
if specified, the shape of the ripple that the focus ring indication will use, if inset focus ring indications are enabled. If left |
enablePressIndication: Boolean = true |
if true, this ripple will draw the indication for press interactions. Set this to |
enableFocusIndication: Boolean = true |
if true, this ripple will draw the indication for focus interactions. Set this to |
enableHoverIndication: Boolean = true |
if true, this ripple will draw the indication for hover interactions. Set this to |
enableDragIndication: Boolean = true |
if true, this ripple will draw the indication for drag interactions. Set this to |
Extension functions
ColorScheme.contentColorFor
fun ColorScheme.contentColorFor(backgroundColor: Color): Color
The Material color system contains pairs of colors that are typically used for the background and content color inside a component. For example, a Button typically uses primary for its background, and onPrimary for the color of its content (usually text or iconography).
This function tries to match the provided backgroundColor to a 'background' color in this ColorScheme, and then will return the corresponding color used for content. For example, when backgroundColor is ColorScheme.primary, this will return ColorScheme.onPrimary.
If backgroundColor does not match a background color in the theme, this will return Color.Unspecified.
| Returns | |
|---|---|
Color |
the matching content color for |
| See also | |
|---|---|
contentColorFor |
DatePickerState.getDisplayedMonth
@RequiresApi(value = 26)
fun DatePickerState.getDisplayedMonth(): YearMonth
Returns a YearMonth representation of the displayed month in this DatePickerState. The returned YearMonth is based on the DatePickerState.displayedMonthMillis, which represents midnight of the first day of the displayed month in UTC milliseconds from the epoch.
DateRangePickerState.getDisplayedMonth
@RequiresApi(value = 26)
fun DateRangePickerState.getDisplayedMonth(): YearMonth
Returns a YearMonth representation of the displayed month in this DateRangePickerState. The returned YearMonth is based on the DateRangePickerState.displayedMonthMillis, which represents midnight of the first day of the displayed month in UTC milliseconds from the epoch.
DatePickerState.getSelectedDate
@RequiresApi(value = 26)
fun DatePickerState.getSelectedDate(): LocalDate?
Returns a LocalDate representation of the selected date in this DatePickerState, or null in case there is no selection.
DateRangePickerState.getSelectedEndDate
@RequiresApi(value = 26)
fun DateRangePickerState.getSelectedEndDate(): LocalDate?
Returns a LocalDate representation of the selected end date in this DateRangePickerState, or null in case there is no selection.
DateRangePickerState.getSelectedStartDate
@RequiresApi(value = 26)
fun DateRangePickerState.getSelectedStartDate(): LocalDate?
Returns a LocalDate representation of the selected start date in this DateRangePickerState, or null in case there is no selection.
DatePickerState.setDisplayedMonth
@RequiresApi(value = 26)
fun DatePickerState.setDisplayedMonth(yearMonth: YearMonth): Unit
Sets the DatePickerState.displayedMonthMillis based on a given YearMonth.
Converts the YearMonth to the start of the first day of that month (midnight) in UTC and apply it to the DatePickerState displayedMonthMillis.
DateRangePickerState.setDisplayedMonth
@RequiresApi(value = 26)
fun DateRangePickerState.setDisplayedMonth(yearMonth: YearMonth): Unit
Sets the DateRangePickerState.displayedMonthMillis based on a given YearMonth.
Converts the YearMonth to the start of the first day of that month (midnight) in UTC and apply it to the DateRangePickerState displayedMonthMillis.
DatePickerState.setSelectedDate
@RequiresApi(value = 26)
fun DatePickerState.setSelectedDate(date: LocalDate?): Unit
Sets the DatePickerState.selectedDateMillis based on a given LocalDate.
Converts the LocalDate to the start of the day (midnight) in UTC and apply it to the DatePickerState selectedDateMillis. Setting null clears the selection.
DateRangePickerState.setSelection
@RequiresApi(value = 26)
fun DateRangePickerState.setSelection(
startDate: LocalDate?,
endDate: LocalDate?
): Unit
Sets the DateRangePickerState start and end dates selection.
The provided LocalDates are converted to the start of the day (midnight) in UTC and applied to the DateRangePickerState.
The function expects the dates to be within the state's year-range, and for the start date to appear before, or be equal, the end date. Also, if an end date is provided (e.g. not null), a start date is also expected to be provided. In any other case, an IllegalArgumentException is thrown.
| Parameters | |
|---|---|
startDate: LocalDate? |
a |
endDate: LocalDate? |
a |
| Throws | |
|---|---|
IllegalArgumentException |
in case the given |
ColorScheme.surfaceColorAtElevation
fun ColorScheme.surfaceColorAtElevation(elevation: Dp): Color
Computes the surface tonal color at different elevation levels e.g. surface1 through surface5.
| Parameters | |
|---|---|
elevation: Dp |
Elevation value used to compute alpha of the color overlay layer. |
| Returns | |
|---|---|
Color |
the |
Morph.toPath
@ExperimentalMaterial3ExpressiveApi
fun Morph.toPath(progress: Float, path: Path = Path(), startAngle: Int = 0): Path
Returns a Path for this Morph.
| Parameters | |
|---|---|
progress: Float |
the |
path: Path = Path() |
a |
startAngle: Int = 0 |
the angle (in degrees) from which to begin drawing the generated path. By default, it is set to 0 degrees, meaning the |
Top-level properties
LocalAbsoluteTonalElevation
val LocalAbsoluteTonalElevation: ProvidableCompositionLocal<Dp>
CompositionLocal containing the current absolute elevation provided by Surface components. This absolute elevation is a sum of all the previous elevations. Absolute elevation is only used for calculating surface tonal colors, and is not used for drawing the shadow in a Surface.
LocalContentColor
val LocalContentColor: ProvidableCompositionLocal<Color>
CompositionLocal containing the preferred content color for a given position in the hierarchy. This typically represents the on color for a color in ColorScheme. For example, if the background color is ColorScheme.surface, this color is typically set to ColorScheme.onSurface.
This color should be used for any typography / iconography, to ensure that the color of these adjusts when the background color changes. For example, on a dark background, text should be light, and on a light background, text should be dark.
Defaults to Color.Black if no color has been explicitly set.
LocalMinimumInteractiveComponentEnforcement
@ExperimentalMaterial3Api
val LocalMinimumInteractiveComponentEnforcement: ProvidableCompositionLocal<Boolean>
CompositionLocal that configures whether Material components that have a visual size that is lower than the minimum touch target size for accessibility (such as Button) will include extra space outside the component to ensure that they are accessible. If set to false there will be no extra space, and so it is possible that if the component is placed near the edge of a layout / near to another component without any padding, there will not be enough space for an accessible touch target.
LocalMinimumInteractiveComponentSize
val LocalMinimumInteractiveComponentSize: ProvidableCompositionLocal<Dp>
CompositionLocal that configures the minimum touch target size for Material components (such as Button) to ensure they are accessible. If a component has a visual size that is lower than the minimum touch target size, extra space outside the component will be included. If set to 0.dp, there will be no extra space, and so it is possible that if the component is placed near the edge of a layout / near to another component without any padding, there will not be enough space for an accessible touch target.
LocalRippleConfiguration
val LocalRippleConfiguration: ProvidableCompositionLocal<RippleConfiguration?>
CompositionLocal used for providing RippleConfiguration down the tree. This acts as a tree-local 'override' for ripples used inside components that you cannot directly control, such as to change the color of a specific component's ripple, or disable it entirely by providing null.
In most cases you should rely on the default theme behavior for consistency with other components. This exists as an escape hatch for individual components and is not intended to be used for full theme customization across an application. For this use case you should instead build your own custom ripple that queries your design system theme values directly using createRippleModifierNode.
The ripple configuration is resolved as follows:
-
LocalRippleThemeConfigurationprovides the highest-level theming configuration for ripples, including whether the focus indication is drawn by inset focus rings. -
LocalRippleConfigurationprovides hierarchical per-ripple configuration forripple, including disabling ripples and their indications. This takes next highest priority. -
rippleparameters allow specifying configuration for individual indication callsites in components.
LocalRippleThemeConfiguration
val LocalRippleThemeConfiguration: ProvidableCompositionLocal<RippleThemeConfiguration>
The overall RippleThemeConfiguration in use by all built-in components and ripple.
By default, this will be RippleDefaults.ThemeConfiguration.
The ripple configuration is resolved as follows:
-
LocalRippleThemeConfigurationprovides the highest-level theming configuration for ripples, including whether the focus indication is drawn by inset focus rings. -
LocalRippleConfigurationprovides hierarchical per-ripple configuration forripple, including disabling ripples and their indications. This takes next highest priority. -
rippleparameters allow specifying configuration for individual indication callsites in components.
LocalTextStyle
val LocalTextStyle: ProvidableCompositionLocal<TextStyle>
CompositionLocal containing the preferred TextStyle that will be used by Text components by default. To set the value for this CompositionLocal, see ProvideTextStyle which will merge any missing TextStyle properties with the existing TextStyle set in this CompositionLocal.
| See also | |
|---|---|
ProvideTextStyle |
LocalTonalElevationEnabled
val LocalTonalElevationEnabled: ProvidableCompositionLocal<Boolean>
Composition Local used to check if ColorScheme.applyTonalElevation will be applied down the tree.
Setting this value to false will cause all subsequent surfaces down the tree to not apply tonalElevation.
MinimumInteractiveLeftAlignmentLine
val MinimumInteractiveLeftAlignmentLine: VerticalAlignmentLine
The vertical AlignmentLine representing the left edge of the component's original visual bounds before any additional space is added by Modifier.minimumInteractiveComponentSize to meet minimum touch target requirements.
When a component's width is less than the minimum interactive size (e.g., LocalMinimumInteractiveComponentSize), Modifier.minimumInteractiveComponentSize expands the layout space. This alignment line provides the offset from the left edge of the expanded bounds to the left edge of the original component content (i.e., its visual bounds). This allows other layouts to align to the component's visual left, ignoring the extra touch-target spacing.
The value of this alignment line is the amount of space added to the left of the component's original left edge. Since Modifier.minimumInteractiveComponentSize centers the content, an equal amount of space is also added to the right of the component.
Visual representation:
Expanded Layout (after Modifier.minimumInteractiveComponentSize() was applied)
+--------------------------+
| | | |
| +----------+ |
| |Component | |
| +----------+ |
| | | |
+--------------------------+
| <-> |
^ ^
| MinimumInteractiveLeftAlignmentLine
Value of MinimumInteractiveLeftAlignmentLine
MinimumInteractiveTopAlignmentLine
val MinimumInteractiveTopAlignmentLine: HorizontalAlignmentLine
The horizontal AlignmentLine representing the top edge of the component's original visual bounds before any additional space is added by Modifier.minimumInteractiveComponentSize to meet minimum touch target requirements.
When a component's height is less than the minimum interactive size (e.g., LocalMinimumInteractiveComponentSize), Modifier.minimumInteractiveComponentSize expands the layout space. This alignment line provides the offset from the top edge of the expanded bounds to the top edge of the original component content (i.e., its visual bounds). This allows other layouts to align to the component's visual top, ignoring the extra touch-target spacing.
The value of this alignment line is the amount of space added above the component's original top edge. Since Modifier.minimumInteractiveComponentSize centers the content, an equal amount of space is also added below the component.
Visual representation:
Expanded Layout (after Modifier.minimumInteractiveComponentSize() was applied)
+------------------------+ ---
| | ^ Value of MinimumInteractiveTopAlignmentLine
| | v
|----+--------------+----| --- MinimumInteractiveTopAlignmentLine
| | Component | |
|----+--------------+----|
| |
| |
+------------------------+
Extension properties
TimePickerState.isHourInputValid
val TimePickerState.isHourInputValid: Boolean
true if the current hourInput represents a valid hour (0-23 for 24h, 0-11 for 12h AM, 12-23 for 12h PM).
TimePickerState.isInputValid
val TimePickerState.isInputValid: Boolean
true if the time input values are valid.
TimePickerState.isMinuteInputValid
val TimePickerState.isMinuteInputValid: Boolean
true if the current minuteInput represents a valid minute (0-59).
TimePickerState.isPm
val TimePickerState.isPm: Boolean
Indicates whether the selected time falls within the period from 12 PM inclusive to 12 AM non inclusive.