{"id":15037393,"url":"https://github.com/exyte/floatingbutton","last_synced_at":"2025-05-14T15:06:48.689Z","repository":{"id":42432452,"uuid":"230217359","full_name":"exyte/FloatingButton","owner":"exyte","description":"Easily customizable floating button menu created with SwiftUI","archived":false,"fork":false,"pushed_at":"2025-03-27T08:57:22.000Z","size":2327,"stargazers_count":1199,"open_issues_count":0,"forks_count":76,"subscribers_count":18,"default_branch":"main","last_synced_at":"2025-04-15T05:16:07.627Z","etag":null,"topics":["swiftui","swiftui-animations","swiftui-components"],"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/exyte.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":"2019-12-26T07:30:45.000Z","updated_at":"2025-04-13T09:32:04.000Z","dependencies_parsed_at":"2023-02-14T06:02:03.056Z","dependency_job_id":"e81d1d2d-bea5-4b68-92ed-ebc4886c46d8","html_url":"https://github.com/exyte/FloatingButton","commit_stats":{"total_commits":47,"total_committers":9,"mean_commits":5.222222222222222,"dds":"0.46808510638297873","last_synced_commit":"cf77c2f124df1423d90a9a1985e9b9ccfa4b9b3e"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exyte%2FFloatingButton","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exyte%2FFloatingButton/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exyte%2FFloatingButton/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exyte%2FFloatingButton/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/exyte","download_url":"https://codeload.github.com/exyte/FloatingButton/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249010221,"owners_count":21197796,"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":["swiftui","swiftui-animations","swiftui-components"],"created_at":"2024-09-24T20:34:30.839Z","updated_at":"2025-04-15T05:16:12.604Z","avatar_url":"https://github.com/exyte.png","language":"Swift","readme":"\u003ca href=\"https://exyte.com/\"\u003e\u003cpicture\u003e\u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/exyte/media/master/common/header-dark.png\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/exyte/media/master/common/header-light.png\"\u003e\u003c/picture\u003e\u003c/a\u003e\n\n\u003ca href=\"https://exyte.com/\"\u003e\u003cpicture\u003e\u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/exyte/media/master/common/our-site-dark.png\" width=\"80\" height=\"16\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/exyte/media/master/common/our-site-light.png\" width=\"80\" height=\"16\"\u003e\u003c/picture\u003e\u003c/a\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u003ca href=\"https://twitter.com/exyteHQ\"\u003e\u003cpicture\u003e\u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/exyte/media/master/common/twitter-dark.png\" width=\"74\" height=\"16\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/exyte/media/master/common/twitter-light.png\" width=\"74\" height=\"16\"\u003e\n\u003c/picture\u003e\u003c/a\u003e \u003ca href=\"https://exyte.com/contacts\"\u003e\u003cpicture\u003e\u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/exyte/media/master/common/get-in-touch-dark.png\" width=\"128\" height=\"24\" align=\"right\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/exyte/media/master/common/get-in-touch-light.png\" width=\"128\" height=\"24\" align=\"right\"\u003e\u003c/picture\u003e\u003c/a\u003e\n\n\u003cimg src=\"https://raw.githubusercontent.com/exyte/media/master/FloatingButton/demo.gif\" width=\"480\" /\u003e\n\n\u003cp\u003e\u003ch1 align=\"left\"\u003eFloatingButton\u003c/h1\u003e\u003c/p\u003e\n\n\u003cp\u003e\u003ch4\u003eEasily customizable floating button menu created with SwiftUI\u003c/h4\u003e\u003c/p\u003e\n\n![](https://img.shields.io/github/v/tag/exyte/FloatingButton?label=Version)\n[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fexyte%2FFloatingButton%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/exyte/FloatingButton)\n[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fexyte%2FFloatingButton%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/exyte/FloatingButton)\n[![SPM](https://img.shields.io/badge/SPM-Compatible-brightgreen.svg)](https://swiftpackageindex.com/exyte/FloatingButton)\n[![Cocoapods](https://img.shields.io/badge/Cocoapods-Deprecated%20after%201.3.0-yellow.svg)](https://cocoapods.org/pods/FloatingButton)\n[![License: MIT](https://img.shields.io/badge/License-MIT-black.svg)](https://opensource.org/licenses/MIT)\n\n# Usage\n\n1. Create main button view and a number of submenu buttons — both should be cast to `AnyView` type.\n2. Pass both to `FloatingButton` constructor:\n\n   ```swift\n   FloatingButton(mainButtonView: mainButton, buttons: buttons)\n   ```\n3. You may also pass a binding which will determine if the menu is currently open. You may use this to close the menu on any submenu button tap for example. \n```swift\nFloatingButton(mainButtonView: mainButton, buttons: buttons, isOpen: $isOpen)\n```\n4. Chain `.straight()` or `.circle()` to specify desired menu type.\n5. Chain whatever you like afterwards. For example:\n    ```swift\n    FloatingButton(mainButtonView: mainButton, buttons: textButtons)\n        .straight()\n        .direction(.top)\n        .alignment(.left)\n        .spacing(10)\n        .initialOffset(x: -1000)\n        .animation(.spring())\n\n    FloatingButton(mainButtonView: mainButton2, buttons: buttonsImage.dropLast())\n        .circle()\n        .startAngle(3/2 * .pi)\n        .endAngle(2 * .pi)\n        .radius(70)\n        .layoutDirection(.counterClockwise)\n    ```\n\n### Universal options\n`spacing` - space between submenu buttons  \n`initialScaling` - size multiplyer for submenu buttons when the menu is closed  \n`initialOffset` - offset for submenu buttons when the menu is closed  \n`initialOpacity` - opacity for submenu buttons when the menu is closed  \n`animation` - custom SwiftUI animation like `Animation.easeInOut()` or `Animation.spring()`  \n`delays` - delay for each submenu button's animation start\n    - you can pass array of delays - one for each element\n    - or you can pass `delayDelta` - then this same delay will be used for each element\n`mainZStackAlignment` - main button and submenu buttons are contained in one ZStack (not an overlay so the menu has a correct size), you can change this ZStack's alignment with this parameter\n`inverseZIndex` - inverse zIndex of mainButton and the children. Use, for example, if you have a negative spacing and want to change the order\n`wholeMenuSize` - pass CGSize binding to get updates of menu's size. Menu's size includes main button frame and all of elements' frames\n`menuButtonsSize` - pass CGSize binding to get updates of combined menu elements' size\n\n### Straight menu only options\n\n`direction` - position of submenu buttons relative to main menu button  \n`alignment` - alignment of submenu buttons relative to main menu button \n\n### Circle only options\n\n`startAngle`  \n`endAngle`  \n`radius` - distance between center of main button and centers of submenu buttons  \n`layoutDirection` - changes the button layout direction from the startAngle to the endAngle\n\n## Examples\n\nTo try the FloatingButton examples:\n- Clone the repo `https://github.com/exyte/FloatingButton.git`\n- Open `FloatingButtonExample.xcodeproj` in the Xcode\n- Try it!\n\n## Installation\n\n### [Swift Package Manager](https://swift.org/package-manager/)\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/exyte/FloatingButton.git\")\n]\n```\n\n## Requirements\n\n* iOS 14.0+ / macOS 11.0+ / watchOS 7.0+\n* Xcode 12+\n\n## Our other open source SwiftUI libraries\n[PopupView](https://github.com/exyte/PopupView) - Toasts and popups library    \n[AnchoredPopup](https://github.com/exyte/AnchoredPopup) - Anchored Popup grows \"out\" of a trigger view (similar to Hero animation)    \n[Grid](https://github.com/exyte/Grid) - The most powerful Grid container    \n[ScalingHeaderScrollView](https://github.com/exyte/ScalingHeaderScrollView) - A scroll view with a sticky header which shrinks as you scroll    \n[AnimatedTabBar](https://github.com/exyte/AnimatedTabBar) - A tabbar with a number of preset animations   \n[MediaPicker](https://github.com/exyte/mediapicker) - Customizable media picker     \n[Chat](https://github.com/exyte/chat) - Chat UI framework with fully customizable message cells, input view, and a built-in media picker  \n[OpenAI](https://github.com/exyte/OpenAI) Wrapper lib for [OpenAI REST API](https://platform.openai.com/docs/api-reference/introduction)    \n[AnimatedGradient](https://github.com/exyte/AnimatedGradient) - Animated linear gradient     \n[ConcentricOnboarding](https://github.com/exyte/ConcentricOnboarding) - Animated onboarding flow    \n[ActivityIndicatorView](https://github.com/exyte/ActivityIndicatorView) - A number of animated loading indicators    \n[ProgressIndicatorView](https://github.com/exyte/ProgressIndicatorView) - A number of animated progress indicators    \n[FlagAndCountryCode](https://github.com/exyte/FlagAndCountryCode) - Phone codes and flags for every country    \n[SVGView](https://github.com/exyte/SVGView) - SVG parser    \n[LiquidSwipe](https://github.com/exyte/LiquidSwipe) - Liquid navigation animation    \n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexyte%2Ffloatingbutton","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fexyte%2Ffloatingbutton","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexyte%2Ffloatingbutton/lists"}