{"id":13659621,"url":"https://github.com/jacobras/ComposeActionMenu","last_synced_at":"2025-04-24T15:30:36.284Z","repository":{"id":99483256,"uuid":"442299930","full_name":"jacobras/ComposeActionMenu","owner":"jacobras","description":"An easy-to-use action/overflow menu for Compose UI.","archived":false,"fork":false,"pushed_at":"2024-05-15T08:46:40.000Z","size":602,"stargazers_count":71,"open_issues_count":3,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-08-02T05:10:55.515Z","etag":null,"topics":["actionbar","compose","materialdesign"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jacobras.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-27T23:46:36.000Z","updated_at":"2024-07-22T17:52:05.000Z","dependencies_parsed_at":"2024-08-02T05:18:04.968Z","dependency_job_id":null,"html_url":"https://github.com/jacobras/ComposeActionMenu","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacobras%2FComposeActionMenu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacobras%2FComposeActionMenu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacobras%2FComposeActionMenu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacobras%2FComposeActionMenu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jacobras","download_url":"https://codeload.github.com/jacobras/ComposeActionMenu/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223958136,"owners_count":17231741,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["actionbar","compose","materialdesign"],"created_at":"2024-08-02T05:01:10.643Z","updated_at":"2025-04-24T15:30:36.278Z","avatar_url":"https://github.com/jacobras.png","language":"Kotlin","funding_links":[],"categories":["Libraries"],"sub_categories":["🍎 Compose UI"],"readme":"# Compose Action Menu\n\n![Android](https://img.shields.io/badge/-android-6EDB8D.svg?style=flat)\n![iOS](http://img.shields.io/badge/-ios-CDCDCD.svg?style=flat)\n![JVM](https://img.shields.io/badge/-jvm-DB413D.svg?style=flat)\n![JS](http://img.shields.io/badge/-js-F8DB5D.svg?style=flat)\n![wasm](https://img.shields.io/badge/-wasm-624DE9.svg?style=flat)\n\nThis multi-platform library provides an easy-to-use action menu for Compose, since Compose doesn't offer this by default.\n\n[![Android Arsenal]( https://img.shields.io/badge/Android%20Arsenal-ComposeActionMenu-green.svg?style=flat )]( https://android-arsenal.com/details/1/8261 )\n\n[![Android Weekly](https://androidweekly.net/issues/issue-499/badge)](https://androidweekly.net/issues/issue-499/)\n\n## Features\n\n- Icons (optional);\n- Selectable/checkable items;\n- Nested sub menus;\n- Automatic overflow for items that don't fit the specified maximum;\n- Kotlin Multiplatform (KMP) since version 2, supporting Android, iOS, JVM (desktop) and JS/WASM (since version 3);\n- Material 2 \u0026 3 support (since version 3).\n\n![Animated preview image](preview.gif)\n\nA web demo is available at https://jacobras.github.io/ComposeActionMenu/.\n\n# Installation\n\n```kotlin\ndependencies {\n    implementation(\"nl.jacobras:compose-action-menu:3.0.1\")\n}\n```\n\n\u003cdetails\u003e\n\u003csummary\u003eVersion 3 and newer are built upon Material 3, whereas previous versions use Material 2. Expand this for\nmigration instructions.\u003c/summary\u003e\n\n### Migrating from v2 to v3\n\nCompose Action Menu version 3 is built upon Material 3. The custom colour names have been changed.\n\n2.x:\n\n```kotlin\nActionMenu(\n    items = listOf(/* items */),\n    colors = DefaultActionMenuColors(\n        dropdownIconTint = myContentColor,\n        dropdownBackgroundColor = myOverflowContainerColor\n    )\n)\n```\n\n3.x:\n\n```kotlin\nActionMenu(\n    items = listOf(/* items */),\n    colors = ActionMenuDefaults.colors(\n        contentColor = myContentColor,\n        overflowContainerColor = myOverflowContainerColor,\n        overflowContentColor = myContentColor\n    )\n)\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eVersion 2 and newer are available from Maven Central, whereas previous versions were distributed through JitPack. Expand\nthis for migration instructions.\u003c/summary\u003e\n\n### Migrating from v1 to v2\n\nCompose Action Menu version 2 is built using KMP. Android-specific resource support is replaced with broader string + Painter support.\n\n1.x:\n\n```kotlin\nRegularActionItem(\n    titleResId = R.string.search,\n    iconDrawable = R.drawable.search\n)\n```\n\n2.x:\n\n```kotlin\nRegularActionItem(\n    title = stringResource(R.string.search),\n    icon = painterResource(R.drawable.search)\n)\n```\n\n\u003c/details\u003e\n\n## Compose version\n\nEach version depends on specific Compose dependencies.\n\n\u003ctable\u003e\n \u003ctr\u003e\n  \u003ctd\u003e\u003cimg alt=\"JitPack\" src=\"https://img.shields.io/badge/mavencentral-v3.0.0-blue\"\u003e\n  \u003c/td\u003e\u003ctd\u003eCompose Multiplatform 1.6.11\u003c/td\u003e\n  \u003ctd\u003eMaterial 3\u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n  \u003ctd\u003e\u003cimg alt=\"JitPack\" src=\"https://img.shields.io/badge/mavencentral-v2.0.0-blue\"\u003e\n  \u003c/td\u003e\u003ctd\u003eCompose Multiplatform 1.5.1\u003c/td\u003e\n  \u003ctd\u003eMaterial 2\u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n  \u003ctd\u003e\u003cimg alt=\"JitPack\" src=\"https://img.shields.io/badge/jitpack-v1.2.0-blue\"\u003e\u003c/td\u003e\n  \u003ctd\u003eCompose 1.4.3\u003c/td\u003e\n  \u003ctd\u003eMaterial 2\u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n  \u003ctd\u003e\u003cimg alt=\"JitPack\" src=\"https://img.shields.io/badge/jitpack-v1.1.0-blue\"\u003e\u003c/td\u003e\n  \u003ctd\u003eCompose 1.3.3\u003c/td\u003e\n  \u003ctd\u003eMaterial 2\u003c/td\u003e\n \u003c/tr\u003e\n \u003ctr\u003e\n  \u003ctd\u003e\u003cimg alt=\"JitPack\" src=\"https://img.shields.io/badge/jitpack-v1.0.0-blue\"\u003e\u003c/td\u003e\n  \u003ctd\u003eCompose 1.1.0-rc01\u003c/td\u003e\n  \u003ctd\u003eMaterial 2\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/table\u003e\n\n# Usage\n\n```kotlin\nval toolbarActions = listOf(\n    RegularActionItem(\n        key = \"search\",\n        title = stringResource(R.string.search),\n        iconVector = Icons.Filled.Search,\n        onClick = { /* TODO: Open search screen */ }\n    )\n)\n\nTopAppBar(\n    actions = { ActionMenu(items = toolbarActions) }\n)\n```\n\n## Supported item types\n\nSeveral different type of actions can be used. These are all sub classes of `ActionItem`.\n\n- Regular item: `RegularActionItem`;\n- Checkable item: `CheckableActionItem`;\n- Radio-toggleable item: `RadioActionItem`;\n- Groups: `GroupActionItem`.\n\n### Creating a group\n\nIs as simple as:\n\n```kotlin\nval subOption1 = RegularActionItem(key = \"subOption1\", /* ... */)\nval subOption2 = RegularActionItem(key = \"subOption2\", /* ... */)\nval subOption3 = RegularActionItem(key = \"subOption3\", /* ... */)\n\nval group = GroupActionItem(\n    key = \"myGroup\",\n    title = stringResource(R.string.group_title),\n    childOptions = listOf(subOption1, subOption2, subOption3)\n)\n```\n\n## Customisation\n\n`ActionMenu` takes some parameters:\n\n- `maxNumberOfIcons` Number of icons to show, including overflow menu icon (if needed);\n- `colors` Optional color configuration. Usage: `colors = ActionMenuDefaults.colors(...)`.\n\n`ActionItem`s can be customised too:\n\n- Use `iconVector` or `iconDrawable` to show an icon next to the item's title;\n- Set `showAsAction` to change if an item will be shown as an icon or in the overflow menu.\n\n# Testing\n\nEvery menu item has a test tag attached to it which is a combination of a `\"ActionMenu\"` prefix and the item's `key`. Example test usage:\n\n```kotlin\n// Menu configuration:\nval item = RegularActionItem(key = \"myKey\", /* ... */)\n\n// Test:\ncomposeTestRule.onNodeWithTag(\"ActionMenu#myKey\").performClick()\n```\n\nThere's a reserved key for the overflow icon: `\"ActionMenu#overflow\"`.\n\n# Sample apps\n\nThe repository contains two sample apps.\n\n* Run Android: `gradlew sample-app:installDebug`\n* Run Desktop: `gradlew sample-desktop:run`\n\n# Production example\n\nMy note taking app uses ComposeActionMenu:\n\n\u003chttps://play.google.com/store/apps/details?id=nl.jacobras.notes\u003e\n\n![](preview_notes.png)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacobras%2FComposeActionMenu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjacobras%2FComposeActionMenu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacobras%2FComposeActionMenu/lists"}