1

I want to create a custom AlertDialog making use of Jetpack Compose. I need to put a colored bar for the title as well as different components such as text, radiobuttons ... The end goal is something like this:

enter image description here

In XML layout I know it could be done, but is it possible in Jetpack Compose?

Paul9999
  • 751
  • 1
  • 11
  • 26

1 Answers1

2

Use Dialog instead of AlertDialog.

https://developer.android.com/reference/kotlin/androidx/compose/ui/window/package-summary#Dialog(kotlin.Function0,androidx.compose.ui.window.DialogProperties,kotlin.Function0)

Inside Dialog you can put any composables you want.

Here is a nice sample:

Show custom alert dialog in Jetpack Compose

bylazy
  • 1,055
  • 1
  • 5
  • 16