SkillAgentSearch skills...

GradientBorderButton

Gradient Border Button Swift

Install / Use

/learn @DemonionFF/GradientBorderButton
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

GradientBorderButton

Button with gradient border or fill.

GradientBorderButton is a Swift library which can help you avoid some boilerplate code.

Main features:

  • Gradient border color for button
  • Dark Mode support
  • Custom gradient direction

|Fill|Border| |-|-| |<img width="352" alt="Screenshot 2023-05-31 at 14 47 40" src="https://github.com/DemonionFF/GradientBorderButton/assets/21122119/706f384e-366c-4a87-84de-19b0694bfd19">|<img width="352" alt="Screenshot 2023-05-31 at 14 47 54" src="https://github.com/DemonionFF/GradientBorderButton/assets/21122119/f1cc5c57-25ab-40bc-9966-6a095ca7a334">|

Simulator Screen Recording - iPhone 14 Pro

Installation

Cocoapods

    pod 'GradientBorderButton'

Manually

  1. Download and drop Sources folder in your project.
  2. Congratulations!

Usage example

  1. Using storyboard, just set class of your button to GradientBorderButton
  2. Programmatically
let gradientButton = GradientBorderButton(frame: CGRect(x: 0, y: 0, width: 200, height: 50))
view.addSubview(gradientButton)

Default values

  • BorderWidth = 1
  • Colors = [.systemGreen, .systemYellow]
  • CornerRadius = .zero
  • Direction = .horizontal

Customization

  1. Available GradientBorderButton.State's: .none, .fill, .border
yourGradientBorderButton.update(state: .fill)
  1. Using GradientBorderButton.Options

Available parameters:

  • direction
  • borderWidth
  • colors
  • cornerRadius

Instantiate your options and pass them to button.

let options = GradientBorderButton.Options(borderWidth: 4)
yourGradientBorderButton.configure(with: options)

Note

Each update with GradientBorderButton.Options updates only options you passed in.

Meta

Distributed under the MIT license. See LICENSE for more information.

Related Skills

View on GitHub
GitHub Stars8
CategoryDevelopment
Updated8mo ago
Forks0

Languages

Swift

Security Score

77/100

Audited on Jul 30, 2025

No findings