'Material Design 3 - Default text sizes for TopAppBars

What default text sizes are used for the CenterAlignedTopAppBar, SmallTopAppBar, MediumTopAppBar and LargeTopAppBar in Material Design 3? Are these sizes specified in dp or sp?

enter image description here



Solution 1:[1]

There's a list of all the styles and their defaults here:

  • textAppearanceTitleLarge: Regular 22sp
  • textAppearanceHeadlineSmall: Regular 24sp
  • textAppearanceHeadlineMedium: Regular 28sp

Outside of specific situations where you want a fixed, consistent size, text size is always defined in sp so it can scale to the user's preferences, and maintain the size relationship between different types of text

Solution 2:[2]

App bar and their height

LargeTopAppBar -> 152.0.dp
MediumTopAppBar -> 112.0.dp
SmallTopAppBar -> 64.0.dp
CenterAlignedTopAppBar -> 64.0.dp

Source:
TopAppBarSmallTokens.kt, TopAppBarMediumTokens.kt and TopAppBarLargeTokens.kt source code.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 cactustictacs
Solution 2 Abhimanyu