0Pricing
Jetpack Compose Academy · Lesson

clickable on Any Composable

Make non-button elements tappable.

Anything Can Be Tappable

Sometimes you want a whole card or row to respond to taps, not a button. The clickable modifier makes any composable react. 👆

The clickable Modifier

Add Modifier.clickable to any element and pass an onClick lambda. The element now handles taps just like a button.

Text(
    "Open profile",
    modifier = Modifier.clickable { open() }
)

All lessons in this course

  1. Button and onClick
  2. Text, Outlined & Icon Buttons
  3. Enabled, Disabled & Loading States
  4. clickable on Any Composable
← Back to Jetpack Compose Academy