Skip to content

SwiftUI ViewModifiers that apply super cool trendy animated or non-animated neon gradient backgrounds

Notifications You must be signed in to change notification settings

drewalth/TrendyGradients

Repository files navigation

TrendyGradients

Super cool boxes with trendy neon gradient backgrounds for SwiftUI. Use the provided ViewModifiers or copy pasta and make your own :)

photo

Installation

Swift Package Manager

Add the following to your Package.swift file:

dependencies: [
    .package(url: "https://github.com/drewalth/TrendyGradients.git", from: "2.0.0")
]

Usage

ViewModifier - Default

import TrendyGradients

struct ContentView: View {
    var body: some View {
        VStack {
            Text("Hello, World!")
                .padding()
                .background(TrendyGradient())
                .cornerRadius(10)
                .padding()
        }.gradient(colors: (Color.pink, Color.purple))
    }
}

ViewModifier - Animated

import TrendyGradients

struct ContentView: View {
    var body: some View {
        VStack {
            Text("Hello, World!")
                .padding()
                .background(TrendyGradient())
                .cornerRadius(10)
                .padding()
        }.animatedGradient(colors1: [Color.red, Color.blue], colors2: [Color.green, Color.yellow])
    }
}

ButtonStyle

import TrendyGradients

Button("Gradient Button") {
  print("Button tapped")
}.gradientButton(colors: (Color.pink, Color.purple))
  .foregroundColor(.white)

About

SwiftUI ViewModifiers that apply super cool trendy animated or non-animated neon gradient backgrounds

Topics

Resources

Stars

Watchers

Forks