ExperimentalMaterial3ExpressiveApi: which APIs still need it
Short answer: in material3 1.5.0-beta02 you need
@OptIn(ExperimentalMaterial3ExpressiveApi::class) only for:
LoadingIndicator,ContainedLoadingIndicator,LoadingIndicatorDefaultsMaterialShapeswithRoundedPolygon.toShape(),toPath(),Morph.toPath()- the checkable
DropdownMenuItem(checked, onCheckedChange, text, shapes, …)overload PullToRefreshDefaults.LoadingIndicator, and oneSliderthumb overload
Everything else in Expressive is stable. The same list applies to beta01.
| API | 1.4.0 | 1.5.0-beta02 |
|---|---|---|
MaterialExpressiveTheme · MotionScheme.expressive() | Internal | Stable |
Typography.*Emphasized · Shapes.largeIncreased | Internal | Stable |
ButtonGroup · ToggleButton · SplitButtonLayout | Not there | Stable |
FloatingActionButtonMenu · MediumFloatingActionButton | Not there | Stable |
HorizontalFloatingToolbar · LargeFlexibleTopAppBar | Not there | Stable |
ShortNavigationBar · WideNavigationRail | Stable | Stable |
SegmentedListItem · LinearWavyProgressIndicator | Not there | Stable |
LoadingIndicator · ContainedLoadingIndicator | Not there | Opt-in |
MaterialShapes · RoundedPolygon.toShape() | Not there | Opt-in |
Opt in only where you need to
Section titled “Opt in only where you need to”// LoadingIndicator is still experimental in 1.5.0-beta02, so opt in where you use it.@OptIn(ExperimentalMaterial3ExpressiveApi::class)@Composablefun ScreenLoading() { // For short indeterminate waits (screen or content loading), instead of a circular spinner. Box(Modifier.fillMaxSize(), contentAlignment = Alignment.Center) { LoadingIndicator() }}
@OptIn(ExperimentalMaterial3ExpressiveApi::class)@Composablefun 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.
Coming from an alpha?
Section titled “Coming from an alpha?”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.