CPS251 Android Development by Scott Shaper

Theme Reference: ColorScheme, Typography, and Shapes

Introduction

Jetpack Compose themes are made up of three main parts: ColorScheme (for colors), Typography (for text styles), and Shapes (for corner roundness). This reference lists all the properties you can set for each, what they do, what type of value they take, and an example or default value. If you don't set a value, Compose uses a sensible default.

How Compose Handles Defaults

If you don't specify a property (like background or headlineLarge), Compose will use a default value from the Material3 design system. You can override any of these by setting your own value in your theme.

ColorScheme Properties

NameWhat It's ForValue TypeExample/Default
primaryMain brand colorColorColor(0xFF6200EE)
onPrimaryText/icon color on primaryColorColor.White
primaryContainerContainer for primary elementsColorColor(0xFFBB86FC)
onPrimaryContainerText/icon on primary containerColorColor.Black
secondarySecondary colorColorColor(0xFF03DAC6)
onSecondaryText/icon color on secondaryColorColor.Black
secondaryContainerContainer for secondary elementsColorColor(0xFF018786)
onSecondaryContainerText/icon on secondary containerColorColor.White
tertiaryTertiary color (optional accent)ColorColor(0xFFB00020)
onTertiaryText/icon color on tertiaryColorColor.White
tertiaryContainerContainer for tertiary elementsColorColor(0xFFFFDAD4)
onTertiaryContainerText/icon on tertiary containerColorColor.Black
backgroundApp backgroundColorColor.White
onBackgroundText/icon color on backgroundColorColor.Black
surfaceSurface color (cards, sheets, etc.)ColorColor.White
onSurfaceText/icon color on surfaceColorColor.Black
surfaceVariantAlternate surface colorColorColor(0xFFE7E0EC)
onSurfaceVariantText/icon on surface variantColorColor.Black
errorError colorColorColor(0xFFB00020)
onErrorText/icon color on errorColorColor.White
errorContainerContainer for error elementsColorColor(0xFFFCD8DF)
onErrorContainerText/icon on error containerColorColor.Black
outlineOutline/border colorColorColor(0xFF79747E)
inverseOnSurfaceText/icon on inverse surfaceColorColor.White
inverseSurfaceInverse surface colorColorColor(0xFF313033)
inversePrimaryInverse primary colorColorColor(0xFFD0BCFF)
surfaceTintTint for surfacesColorColor(0xFF6200EE)
outlineVariantAlternate outline colorColorColor(0xFFC4C7C5)
scrimOverlay color for modalsColorColor(0xFF000000)

Typography Properties

NameWhat It's ForValue TypeExample/Default
displayLargeVery large headingsTextStylefontSize=57.sp
displayMediumLarge headingsTextStylefontSize=45.sp
displaySmallMedium headingsTextStylefontSize=36.sp
headlineLargeSection headingsTextStylefontSize=32.sp
headlineMediumSubsection headingsTextStylefontSize=28.sp
headlineSmallSmall headingsTextStylefontSize=24.sp
titleLargeLarge titlesTextStylefontSize=22.sp
titleMediumMedium titlesTextStylefontSize=16.sp
titleSmallSmall titlesTextStylefontSize=14.sp
bodyLargeMain body textTextStylefontSize=16.sp
bodyMediumSecondary body textTextStylefontSize=14.sp
bodySmallSmall body textTextStylefontSize=12.sp
labelLargeLarge labels/buttonsTextStylefontSize=14.sp
labelMediumMedium labelsTextStylefontSize=12.sp
labelSmallSmall labelsTextStylefontSize=11.sp

Shapes Properties

NameWhat It's ForValue TypeExample/Default
extraSmallSmallest components (chips, etc.)CornerBasedShapeRoundedCornerShape(4.dp)
smallSmall componentsCornerBasedShapeRoundedCornerShape(8.dp)
mediumDefault for buttons, cardsCornerBasedShapeRoundedCornerShape(12.dp)
largeDialogs, sheetsCornerBasedShapeRoundedCornerShape(16.dp)
extraLargeVery rounded cornersCornerBasedShapeRoundedCornerShape(28.dp)

Tips for Using Theme Properties

  • Use these properties with MaterialTheme.colorScheme, MaterialTheme.typography, and MaterialTheme.shapes in your UI.
  • Only override the values you want to change—Compose will use defaults for the rest.
  • Check the official Compose Material3 docs for the latest property lists and defaults.