{"id":22424130,"url":"https://github.com/lfroms/fluid-menu-bar-extra","last_synced_at":"2026-02-27T11:02:31.052Z","repository":{"id":64935576,"uuid":"579555206","full_name":"lfroms/fluid-menu-bar-extra","owner":"lfroms","description":"🖥️ A lightweight tool for building great menu bar extras with SwiftUI.","archived":false,"fork":false,"pushed_at":"2025-11-25T21:09:04.000Z","size":28,"stargazers_count":81,"open_issues_count":1,"forks_count":16,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-11-29T02:15:21.009Z","etag":null,"topics":["macos","menubar","swift","swiftui"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/lfroms.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-12-18T04:21:10.000Z","updated_at":"2025-11-25T21:08:27.000Z","dependencies_parsed_at":"2023-02-12T12:55:16.271Z","dependency_job_id":"6fea46a9-f853-4a11-9e00-65d2da70a753","html_url":"https://github.com/lfroms/fluid-menu-bar-extra","commit_stats":{"total_commits":8,"total_committers":2,"mean_commits":4.0,"dds":0.125,"last_synced_commit":"b8d41bc1c2609c3943c47d00fb539de38f90b817"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/lfroms/fluid-menu-bar-extra","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lfroms%2Ffluid-menu-bar-extra","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lfroms%2Ffluid-menu-bar-extra/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lfroms%2Ffluid-menu-bar-extra/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lfroms%2Ffluid-menu-bar-extra/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lfroms","download_url":"https://codeload.github.com/lfroms/fluid-menu-bar-extra/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lfroms%2Ffluid-menu-bar-extra/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29892063,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-27T09:48:51.284Z","status":"ssl_error","status_checked_at":"2026-02-27T09:48:43.992Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["macos","menubar","swift","swiftui"],"created_at":"2024-12-05T18:14:26.555Z","updated_at":"2026-02-27T11:02:31.010Z","avatar_url":"https://github.com/lfroms.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  \u0026#128421;\n  \u003cbr\u003e\n  FluidMenuBarExtra \n  \u003cbr\u003e\n\u003c/h1\u003e\n\n\u003ch4 align=\"center\"\u003eA lightweight tool for building great menu bar extras with SwiftUI.\u003c/h4\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/lfroms/fluid-menu-bar-extra/issues\"\u003e\u003cimg alt=\"GitHub issues\" src=\"https://img.shields.io/github/issues/lfroms/fluid-menu-bar-extra\"\u003e\u003c/a\u003e\n  \u003cimg alt=\"GitHub contributors\" src=\"https://img.shields.io/github/contributors/lfroms/fluid-menu-bar-extra\"\u003e\n  \u003ca href=\"https://github.com/lfroms/fluid-menu-bar-extra/stargazers\"\u003e\u003cimg alt=\"GitHub stars\" src=\"https://img.shields.io/github/stars/lfroms/fluid-menu-bar-extra\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/lfroms/fluid-menu-bar-extra\"\u003e\u003cimg alt=\"GitHub license\" src=\"https://img.shields.io/github/license/lfroms/fluid-menu-bar-extra\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://swiftpackageindex.com/lfroms/fluid-menu-bar-extra\"\u003e\u003cimg src=\"https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Flfroms%2Ffluid-menu-bar-extra%2Fbadge%3Ftype%3Dplatforms\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"Menu Sample\" src=\"https://user-images.githubusercontent.com/3951690/208313040-34f97eb5-1ac2-4f25-a510-ba30da2303e8.gif\" width=\"300px\"\u003e\n\u003c/p\u003e\n\n## About\n\nSwiftUI's built in [`MenuBarExtra`](https://developer.apple.com/documentation/swiftui/menubarextra) API makes it easy to create menu bar applications in pure SwiftUI. However, the current implementation of the [`WindowMenuBarExtraStyle`](https://developer.apple.com/documentation/swiftui/windowmenubarextrastyle) is limited in that it doesn't fade out when dismissed like traditional menu items, doesn't persist selection state when the menu is opened, and uses a less-than-ideal resizing mechanism that leaves your app feeling unpolished.\n\nFluidMenuBarExtra is a lightweight package that provides a convenient API for creating seamless menu bar extras with SwiftUI in both AppKit and SwiftUI apps. Once MenuBarExtra is improved in future versions of macOS, switching back to MenuBarExtra is as simple as moving a few lines of SwiftUI code back to your `App`.\n\n### Key Features\n\n- Animated resizing when SwiftUI content changes.\n- Ability to access the scene phase of the menu using the `scenePhase` environment key.\n- Persisted highlighting of the menu bar button.\n- Smooth fade out animation when the menu is dismissed.\n- Automatic repositioning if the menu would otherwise surpass the screen edge.\n\n## Usage\n\nTo use FluidMenuBarExtra, initialize a `FluidMenuBarExtra` once during your app's lifecycle. Multiple instances of `FluidMenuBarExtra` can exist if you need more than one menu bar extra.\n\nFirst, define an application delegate. Don't worry, your app's entry point will still be based in SwiftUI.\n\n```swift\nclass AppDelegate: NSObject, NSApplicationDelegate {\n    private var menuBarExtra: FluidMenuBarExtra?\n\n    func applicationDidFinishLaunching(_ notification: Notification) {\n        self.menuBarExtra = FluidMenuBarExtra(title: \"My Menu\", systemImage: \"cloud.fill\") {\n            Text(\"My SwiftUI View\")\n        }\n    }\n}\n```\n\nThen, use the `@NSApplicationDelegateAdaptor` property wrapper to attach the delegate to your SwiftUI application:\n\n```swift\nimport SwiftUI\n\n@main\nstruct MyApplication: App {\n    @NSApplicationDelegateAdaptor private var appDelegate: AppDelegate\n\n    var body: some Scene {\n        Settings {\n            SettingsTabs()\n        }\n    }\n}\n```\n\nThat's it! The menu bar extra will be installed as long as the reference to the `FluidMenuBarExtra` exists. When the reference is deleted or set to `nil`, the item will be removed from the menu bar.\n\n\u003e 💡 **Tip:** If any stateful properties or utilities need to be shared between your menu bar extra and other windows, you can move those properties to your `AppDelegate`. To allow SwiftUI views to consume published properties, conform the delegate class to `ObservableObject`. SwiftUI will then automatically insert the delegate into the environment. [Learn more](https://developer.apple.com/documentation/swiftui/uiapplicationdelegateadaptor).\n\n## Caveats\n\n- SwiftUI applications require at least one `Scene` be valid. Because FluidMenuBarExtra is not created in a scene, you'll need at least one other scene in the body of your `App`:\n   - A common trick is to use a `Settings` scene with an `EmptyView()` inside.\n   - Alternatively, you can try using the undocumented yet still public `_EmptyScene()`, but no guarantees that App Review will like it.\n- Since FluidMenuBarExtra uses an `NSWindow`, not an `NSMenu`, you'll find that the window presented by FluidMenuBarExtra has a slighter wider corner radius than other menus.\n\n## Contributions\n\nAll contributions are welcome. If you have a need for this kind of package, feel free to resolve any issues and add any features that may be useful.\n\n## License\n\nFluidMenuBarExtra is released under the [MIT License](LICENSE) unless otherwise noted.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flfroms%2Ffluid-menu-bar-extra","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flfroms%2Ffluid-menu-bar-extra","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flfroms%2Ffluid-menu-bar-extra/lists"}