Easily customizable floating button menu created with SwiftUI


Easily customizable floating button menu created with SwiftUI

We are a development agency building phenomenal apps.

Travis CI Version Carthage Compatible License Platform Twitter


  1. Create main button view and a number of submenu buttons — both should be cast to AnyView type.

  2. Pass both to FloatingButton constructor:

    FloatingButton(mainButtonView: mainButton, buttons: buttons)
  3. 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.

FloatingButton(mainButtonView: mainButton, buttons: buttons, isOpen: $isOpen)
  1. Chain .straight() or .circle() to specify desired menu type.
  2. Chain whatever you like afterwards. For example:
    FloatingButton(mainButtonView: mainButton, buttons: textButtons)
        .initialOffset(x: -1000)
    FloatingButton(mainButtonView: mainButton2, buttons: buttonsImage.dropLast())
        .startAngle(3/2 * .pi)
        .endAngle(2 * .pi)

Universal options

spacing - space between submenu buttons
initialScaling - size multiplyer for submenu buttons when the menu is closed
initialOffset - offset for submenu buttons when the menu is closed
initialOpacity - opacity for submenu buttons when the menu is closed
animation - custom SwiftUI animation like Animation.easeInOut() or Animation.spring()
delays - delay for each submenu button's animation start - you can pass array of delayes - one for each element - or you can pass delayDelta - then this same delay will be used for each element wholeMenuSize - pass CGSize binding to get updates of menu's size. Menu's size inclides main button frame and all of elements' frames

Straight menu only options

direction - position of submenu buttons relative to main menu button
alignment - alignment of submenu buttons relative to main menu button

Circle only options



To try out the FloatingButton examples:

  1. Clone the repo git clone git@github.com:exyte/FloatingButton.git.
  2. Open terminal and run cd <FloatingButtonRepo>/Example.
  3. Run pod install to install all dependencies.
  4. Run xed . to open project in the Xcode.
  5. Try it!


Swift Package Manager

dependencies: [
    .package(url: "https://github.com/exyte/FloatingButton.git")


pod 'FloatingButton'


github "Exyte/FloatingButton"


  • iOS 14.0+ / macOS 10.15+ / tvOS 14.0+ / watchOS 7.0+
  • Xcode 12+

Our other open source SwiftUI libraries

PopupView - Toasts and popups library
Grid - The most powerful Grid container
ScalingHeaderScrollView - A scroll view with a sticky header which shrinks as you scroll
AnimatedTabBar - A tabbar with number of preset animations
MediaPicker - Customizable media picker
ConcentricOnboarding - Animated onboarding flow
ActivityIndicatorView - A number of animated loading indicators
ProgressIndicatorView - A number of animated progress indicators
SVGView - SVG parser
LiquidSwipe - Liquid navigation animation


  • Swift Tools 5.3.0
View More Packages from this Author


  • None
Last updated: Wed Mar 29 2023 05:29:46 GMT-0500 (GMT-05:00)