Skip to content

nekoribocchi/GlassmorphismUI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GlassmorphismUI

This is a glassmorphism UI package. Neutral Minimal Phone Frames Mockup Pinterest Pin (1)

Installation

To add GlassmophismUI to your project:

  • Open your project in Xcode
  • Go to File > Swift Packages > Add Package Dependency...
  • Search for GlassmophismUI or https://github.com/nekoribocchi/GlassmorphismUI.git and follow Xcode's installation dialogs.
  • Import GlassmorphismUI whereever you want to use it

Usage

Rounded Top Bar

iPhone 16 Plus iPad Pro 13-inch
BDButtonTrayItemAnimation
RoundedTopBar(){
            Text("Insert any custom View content here")
                .foregroundColor(.white)
        }

You can customize the color, gradient, height, and more:

iPhone 16 Plus iPad Pro 13-inch
BDButtonTrayItemAnimation
RoundedTopBar(startColor: .blue,
                      endColor: .green,
                      heightRatio:0.3,
                      isGradient:true){
            Text("Insert any custom View content here")
                .foregroundColor(.white)
        }

Rounded Bottom Bar

iPhone 16 Plus iPad Pro 13-inch
BDButtonTrayItemAnimation
ZStack {
            GradientBackground(startColor: .g_Orange, endColor: .g_Purple)
            RoundedBottomBar{
                Text("Insert any custom View content here")
                                .foregroundColor(.white)
            }
        }

You can customize the color, gradient, height, and more:

iPhone 16 Plus iPad Pro 13-inch
BDButtonTrayItemAnimation
        RoundedBottomBar(startColor:.blue,
                         endColor: .green,
                         opacity: 0.8,
                         heightRatio: 0.3,
                         text: nil,
                         isGradient: true){
            Text("Insert any custom View content here")
                .foregroundColor(.white)
        }

CapsuleButton

iPhone 16 Plus iPad Pro 13-inch
CapsuleButton(
    // Text displayed on the button
    title: "Button",
    
    // Ratio of the button's height to the screen height (10% of screen height)
    heightRatio: 0.1,
    
    // Background color of the button
    backgroundColor: .r_Purple,
    
    // Text color
    textColor: .white,
    
    // Font name used for the button title
    //Please look at 'How to use custom font'  below
    font: "PottaOne-Regular",
    
    // Furigana (small text above the main title, useful for Japanese reading aid)
    furigana: "button",
    
    // System icon name (e.g., SF Symbols)
    iconName: "xmark",
    
    // Color of the icon
    iconColor: .white,
    
    // Action to perform when the button is tapped
    action: {
        print("Button Tapped!")
    }
)
  • How to use custom font
    if you want to user custom font, please follow the steps below.
  1. download font from a font distribustion website. (ex. https://fonts.google.com/)
  2. Add the font to your Xcode project
    Drag and drop the font file (e.g., .ttf or .otf) into your Xcode project.
  3. Update Info.plist
    Open Info.plist and add a new key called Fonts provided by application (or UIAppFonts). Then add the file name of the font, including the extension (e.g., CustomFont.ttf).

Glass-style Rounded Rectangle View

iPhone 16 Plus iPad Pro 13-inch
        ZStack {
            GradientBackground(startColor: .g_Purple, endColor: .g_Orange)
                
            VStack {
                Spacer()
                RoundRectangleView(heightRatio: 0.7) {
                    //Add Any View
                    VStack{
                        Image(systemName: "star.fill")
                        Text("Add Any View")
                    }
                }
                .padding()
            }
        }

About

This is the SwiftUI Package. You can easily incorporate Glassmorphism-style UI into your project with this packge.

Topics

Resources

License

Stars

6 stars

Watchers

1 watching

Forks

Packages

 
 
 

Contributors

Languages