This SwiftUI project showcases a beautifully animated Radial Menu triggered by a central Floating Action Button (FAB) β a modern UI pattern commonly used in mobile apps. Tapping the FAB reveals a circular layout of customizable action buttons, each with smooth animation and clean design.
β¨ Built entirely with SwiftUI β no third-party libraries!
- How to create a floating action button (FAB) in SwiftUI
- Layering views with
ZStack - Using
@Stateand.offset()for animation - Circular layout with trigonometric calculations
- Smooth expand/collapse animation with
.spring() - Building reusable UI components
π RadialMenuSwiftUI/
βββ RadialMenu.swift # Main view with FAB and radial buttons
βββ RadialMenuButton.swift # Model for each button (icon, color, action)
βββ RadialMenu.gif # Demo animation preview
βββ README.md # Project documentation
-
Clone the repository:
git clone https://github.com/UpendraVerma/RadialMenuSwiftUI.git
-
Open the project in Xcode:
open RadialMenuSwiftUI.xcodeproj
-
Run the project on any iPhone Simulator or physical device (iOS 15+)
- β Add or remove buttons in the radial menu array
- π¨ Change the colors and SF Symbols for each button
- π Adjust the radius or animation delay for different effects
- π Use this as a base for more complex radial or context menus
Created by Upendra Verma
π https://github.com/UpendraVerma
This project is licensed under the MIT License
If you found this helpful, feel free to β star the repo, fork it, and share with fellow developers!
