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!
