{"id":24665627,"url":"https://github.com/peterfriese/actionmenu","last_synced_at":"2025-10-08T03:30:16.562Z","repository":{"id":273786408,"uuid":"920692244","full_name":"peterfriese/ActionMenu","owner":"peterfriese","description":"This repo accompanies my blog post about building a reusable action menu:","archived":false,"fork":false,"pushed_at":"2025-01-22T23:37:44.000Z","size":7424,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-23T00:26:43.386Z","etag":null,"topics":["swift","swiftui"],"latest_commit_sha":null,"homepage":"https://peterfriese.dev/blog/2025/swiftui-action-menu/","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/peterfriese.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":"2025-01-22T15:57:36.000Z","updated_at":"2025-01-22T23:37:48.000Z","dependencies_parsed_at":"2025-01-23T00:36:48.464Z","dependency_job_id":null,"html_url":"https://github.com/peterfriese/ActionMenu","commit_stats":null,"previous_names":["peterfriese/actionmenu"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterfriese%2FActionMenu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterfriese%2FActionMenu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterfriese%2FActionMenu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/peterfriese%2FActionMenu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/peterfriese","download_url":"https://codeload.github.com/peterfriese/ActionMenu/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":235674159,"owners_count":19027526,"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":["swift","swiftui"],"created_at":"2025-01-26T07:12:57.382Z","updated_at":"2025-10-08T03:30:16.550Z","avatar_url":"https://github.com/peterfriese.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"## About ActionMenu\n\nActionMenu is a SwiftUI library that provides a flexible and easy-to-use menu component for iOS applications, similar to the one in Apple's built-in mail app.\n\n![Video showing an iOS UI with a list of fruits. As the user selects the \"More\" action from the swipe action bar, a bottom sheet with a number of actions appears. The user selects several of the listed actions to manipulate the fruit list items.](Resources/demo.gif)\n\n## Requirements\n\n- iOS 18.0+\n- Swift 6.0+\n\n## Installation\n\n### Xcode\n\n1. In Xcode, open your project and navigate to File \u003e Add Packages...\n2. In the search field, enter the package repository URL: `https://github.com/peterfriese/ActionMenu`\n3. Select the package when it appears in the search results\n4. Choose your target application in the \"Add to Project\" field\n5. Click \"Add Package\"\n\n\n### Swift Package Manager\n\nAdd the following dependency to your `Package.swift` file:\n\n```swift\ndependencies: [\n  .package(url: \"https://github.com/peterfriese/ActionMenu\", from: \"1.0.0\")\n]\n```\n\nThen, include \"ActionMenu\" as a dependency for your target:\n\n```swift\ntargets: [\n  .target(\n    name: \"YourTarget\",\n    dependencies: [\"ActionMenu\"])\n]\n```\n\n## Quick Start\n\n1. Import the package in your SwiftUI file:\n\n```swift\nimport SwiftUI\nimport ActionMenu\n```\n\n2. Use the `.actionMenu` modifier on any view:\n\n```swift\n.actionMenu(title: \"Actions\", isPresented: $isShowingMenu) {\n  Button(\"Option 1\") {\n    // Handle option 1\n  }\n  Button(\"Option 2\") {\n    // Handle option 2\n  }\n}\n```\n\n## Example\n\nHere's a complete example showing how to use ActionMenu with a list:\n\n```swift\nstruct ContentView: View {\n  @State private var isMoreActionTapped = false\n  @State private var selectedItem: String? = nil\n    \n  var body: some View {\n    List(items, id: \\.self) { item in\n      Text(item)\n        .swipeActions {\n          Button(\"More\", systemImage: \"ellipsis.circle\") {\n            selectedItem = item\n            isMoreActionTapped.toggle()\n          }\n        }\n    }\n    .actionMenu(title: \"Actions\", isPresented: $isMoreActionTapped) {\n      Button(\"Flag\", systemImage: \"flag\") {\n        // Handle edit action\n      }\n      Button(\"Delete\", role: .destructive) {\n        // Handle delete action\n      }\n    }\n  }\n}\n```\n\n## Styling\n\nThe `ActionMenu` can be styled using standard SwiftUI techniques. The default appearance is designed to mimic the look and feel of the menu in Apple's Mail app.\n\n### Backported Styles\n\nTo ensure the menu looks \"at home\" on different iOS versions, `ActionMenu` uses a backporting pattern for some of its styles. For example, the toolbar button on the sheet will use the `.glassProminent` button style on iOS 26 and newer, while falling back to a standard button style on older versions.\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a PR.\n\n## License\n\nActionMenu is licensed under the Apache 2 license. See the [LICENSE](LICENSE) file for details.\n\n## Author\n\nPeter Friese\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterfriese%2Factionmenu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpeterfriese%2Factionmenu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpeterfriese%2Factionmenu/lists"}