Skip to content

Latest commit

 

History

22 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Floating Action Button for SwiftUI

Swift Platform License Version

FABUI is a Swift package that allows the creation of customizable Floating Action Buttons (FAB) using SwiftUI.

Customization

You can customize the FABModifier with various parameters:

  • icon: The icon displayed on the FAB.
  • color: The background color of the FAB.
  • iconColor: (Optional) The color of the icon. Default is white.
  • shapeStyle: (Optional) The shape of the FAB. Default is circle. You can use .roundedRectangle(cornerRadius) to specify a rounded rectangle with a corner radius.
  • radius: (Optional) The shadow radius of the FAB. Default is 1.
  • action: The action to perform when the FAB is tapped.

Requirements

  • Swift 5.5 or later
  • iOS 17.0 or later

Installation

You can include this package in your project via Swift Package Manager. In your Xcode project, go to "File" -> "Swift Packages" -> "Add Package Dependency" and add the following URL:

https://github.com/fatihdurmaz/FABUI

Usage/Examples

import SwiftUI
import FABUI

struct ContentView: View {
    var body: some View {
        NavigationStack {
            VStack {
                Text("Hello, SwiftUI!")
            }
            .fab(icon: Image(systemName: "plus"), color: .orange, action: {
                print("Hello, SwiftUI!")
            })
            .navigationTitle("FABUI")
        }
    }
}

Licence

This project is licensed under the MIT License. See the LICENSE file for more information.

Contributing

If you would like to contribute, please submit a pull request or report an issue. Thank you for your contributions!

About

Floating Action Button for SwiftUI

Topics

Resources

Stars

9 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages