CustomButton
is a SwiftUI component for creating a button with a custom style. It provides customization for the button’s action and label while adapting to the current color scheme.
Button (light mode)
Button (dark mode)
CustomButton.swift
file in your SwiftUI project. File Link
action: () -> Void
(Required) - The closure that gets called when the button is tapped.label: String
(Required) - The label displayed on the button.Note:fontWeight
is internally set to.medium
as a default, and the color scheme is automatically detected.
CustomButton
component: