Skip to content

Instantly share code, notes, and snippets.

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

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

Select an option

Save MaherSafadii/c0d8ef049e6441deb92b7f1e9ea77e04 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, and Material 3.


📦 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()

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()

🧩 Insets (Compose + Accompanist)

  • systemBarsPadding()
  • statusBarsPadding()
  • navigationBarsPadding()
  • imePadding()

âš¡ Tips

Make Text Marquee

Text(
    "Scrolling text example",
    maxLines = 1,
    softWrap = false,
    overflow = TextOverflow.Visible,
    modifier = Modifier
        .width(160.dp)
        .basicMarquee()
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment