Skip to content

ExperimentalMaterial3ExpressiveApi: which APIs still need it

Short answer: in material3 1.5.0-beta02 you need @OptIn(ExperimentalMaterial3ExpressiveApi::class) only for:

  • LoadingIndicator, ContainedLoadingIndicator, LoadingIndicatorDefaults
  • MaterialShapes with RoundedPolygon.toShape(), toPath(), Morph.toPath()
  • the checkable DropdownMenuItem(checked, onCheckedChange, text, shapes, …) overload
  • PullToRefreshDefaults.LoadingIndicator, and one Slider thumb overload

Everything else in Expressive is stable. The same list applies to beta01.

API1.4.01.5.0-beta02
MaterialExpressiveTheme · MotionScheme.expressive()InternalStable
Typography.*Emphasized · Shapes.largeIncreasedInternalStable
ButtonGroup · ToggleButton · SplitButtonLayoutNot thereStable
FloatingActionButtonMenu · MediumFloatingActionButtonNot thereStable
HorizontalFloatingToolbar · LargeFlexibleTopAppBarNot thereStable
ShortNavigationBar · WideNavigationRailStableStable
SegmentedListItem · LinearWavyProgressIndicatorNot thereStable
LoadingIndicator · ContainedLoadingIndicatorNot thereOpt-in
MaterialShapes · RoundedPolygon.toShape()Not thereOpt-in
// LoadingIndicator is still experimental in 1.5.0-beta02, so opt in where you use it.
@OptIn(ExperimentalMaterial3ExpressiveApi::class)
@Composable
fun ScreenLoading() {
// For short indeterminate waits (screen or content loading), instead of a circular spinner.
Box(Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {
LoadingIndicator()
}
}
@OptIn(ExperimentalMaterial3ExpressiveApi::class)
@Composable
fun ButtonLoading() {
// Contained = on a filled circle, for use over content or inside pull-to-refresh.
ContainedLoadingIndicator()
}

A file-level @file:OptIn(ExperimentalMaterial3ExpressiveApi::class) is fine in files that use MaterialShapes a lot. Avoid project-wide opt-ins in Gradle: they hide which calls are still unstable when you upgrade.

In the 1.5.0 alphas most of Expressive was experimental, and some names changed between alphas. After upgrading, delete opt-ins one file at a time and let the compiler show you which ones are still needed.

Full API status table and deprecations →

Want your agent to get this right every time? Install the skill. If this page helped,star the repo on GitHub.

Built by Sanikant. Set in Google Sans Flex (SIL Open Font License), icons from Material Symbols (Apache 2.0). Material Design is a Google trademark; this project is not affiliated with Google.