Skip to content

Instantly share code, notes, and snippets.

@MaherSafadii
Created November 24, 2025 11:31
Show Gist options
  • Select an option

  • Save MaherSafadii/c227c2952f269e4075ce123949b5e838 to your computer and use it in GitHub Desktop.

Select an option

Save MaherSafadii/c227c2952f269e4075ce123949b5e838 to your computer and use it in GitHub Desktop.

Jetpack Compose Modifier Cheat Sheet

A categorized overview of the most commonly used Modifier extension functions across
Compose UI, Foundation, Material 3, and Shared Element / Shadow APIs.


πŸ“¦ Core UI Modifiers (androidx.compose.ui.Modifier)

Layout

  • fillMaxSize()
  • fillMaxWidth()
  • fillMaxHeight()
  • wrapContentSize()
  • wrapContentWidth()
  • wrapContentHeight()
  • size()
  • width()
  • height()
  • sizeIn()
  • widthIn()
  • heightIn()
  • requiredSize()
  • requiredWidth()
  • requiredHeight()
  • aspectRatio()
  • offset()
  • absoluteOffset()
  • padding()
  • paddingFromBaseline()
  • defaultMinSize()
  • onPlaced()

Alignment

  • align()
  • alignBy()
  • alignByBaseline()
  • matchParentSize()

Drawing / Graphics

  • background()
  • border()
  • clip()
  • clipToBounds()
  • drawBehind()
  • drawWithContent()
  • alpha()
  • graphicsLayer()
  • paint()
  • shadow()
  • dropShadow() (new)
  • innerShadow() (new)

Input / Interaction

  • clickable()
  • combinedClickable()
  • pointerInput()
  • pointerInteropFilter()
  • pointerHoverIcon()
  • scrollable()
  • draggable()
  • transformable()
  • onGloballyPositioned()
  • onSizeChanged()

Semantics / Accessibility

  • semantics()
  • clearAndSetSemantics()
  • contentDescription()
  • focusable()
  • focusRequester()
  • focusProperties()
  • focusTarget()

Animation

  • animateContentSize()

Misc

  • zIndex()
  • testTag()
  • debugInspectorInfo {}

🌿 Foundation Modifiers (androidx.compose.foundation)

Scrolling

  • verticalScroll()
  • horizontalScroll()

Gestures

  • clickable()
  • combinedClickable()
  • scrollable()
  • draggable()
  • swipeable()
  • transformable()

Selection

  • selectable()
  • toggleable()
  • onFocusChanged()

Text Utilities

  • basicMarquee()

Indication

  • indication()

Graphics

  • blur()
  • drawWithCache()
  • magnifier()

Background / Border

  • background()
  • border()

🎨 Material 3 (androidx.compose.material3)

Interaction

  • hoverable()
  • ripple()

Surface

  • surface()
  • surfaceColorAtElevation()

πŸ”„ Shared Element & Shared Bounds Transitions

(via SharedTransition API)

These require wrapping content in SharedTransitionLayout.

Core Modifiers

  • sharedElement()
  • sharedBounds()

Advanced Modifiers

  • sharedElementWithCallerManagedVisibility()
  • renderInSharedTransitionScopeOverlay()

Supporting Utilities

  • skipToLookaheadSize() (helps prevent unwanted layout during transitions)

🧭 Insets (Compose + Accompanist)

  • systemBarsPadding()
  • statusBarsPadding()
  • navigationBarsPadding()
  • imePadding()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment