A customizable, animated and easy-to-use popup menu component for Jetpack Compose.
- 🎨 Fully customizable theming support
- ✨ Smooth open/close animations
- 📱 Automatic positioning
- 🌓 Light/Dark theme support
- 🎯 Icons and separators support
- 📏 Customizable dimensions
Add JitPack repository to your build file:
// settings.gradle.kts
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}// app/build.gradle.kts
dependencies {
implementation 'com.github.ahmet-ozberk:EasyPopupMenu:Tag'
}val state = rememberEasyPopupState()
EasyPopupMenu(
state = state,
items = listOf(
EasyPopupMenuItem(
text = "Option 1",
onClick = { state.isVisible = false }
),
EasyPopupMenuItem(
text = "Option 2",
onClick = { state.isVisible = false }
)
)
) {
Text("Open Menu")
}Note: If you write theme properties in EasyPopupMenuItem, the global theme properties for that EasyPopupMenuItem will be disabled.
val customTheme = EasyPopupMenuTheme(
backgroundColor = Color.DarkGray,
textColor = Color.White,
cardCornerRadius = 16.dp,
separator = Separator(
color = Color.Gray,
thickness = 1.dp
)
)
EasyPopupMenu(
state = state,
theme = customTheme,
items = listOf(/* ... */)
) {
// Content
}EasyPopupMenuItem(
text = "Search",
leading = {
Icon(
Icons.Rounded.Search,
contentDescription = null,
modifier = Modifier.size(18.dp)
)
},
onClick = { /* ... */ }
)| Property | Description | Default Value |
|---|---|---|
| minWidth | Minimum width | 180.dp |
| maxWidth | Maximum width | 256.dp |
| minHeight | Minimum height | 32.dp |
| cardCornerRadius | Corner radius | 8.dp |
| backgroundColor | Background color | Color(0xFFF8F9FA) |
| textColor | Text color | Color(0xFF000000) |
| textSize | Text size | 14.sp |
| fontWeight | Font weight | FontWeight.Normal |
| separator | Separator style | Separator() |
| cardElevation | Shadow elevation | 12f |
| elevationAlpha | Shadow opacity | 0.1f |
| dampingRatio | Animation damping ratio | 0.75f |
| stiffness | Animation stiffness | 400f |
| Property | Description |
|---|---|
| text | Menu item text |
| leading | Leading icon |
| trailing | Trailing icon |
| onClick | Click action |
| backgroundColor | Item background color |
| textColor | Item text color |
| separator | Item specific separator |
Feel free to open issues and submit pull requests.

