Skip to content
Follow Button preview
Rendered from the SwiftUI source on this page.

Follow Button

From syxUI — written for both platforms, not translated between them.

A follow / following toggle pair.

Buttons · SwiftUI · iOS 17

  • buttons
  • swiftui

The actual source

FollowButtonCard.swift
// Follow Button · syxUI · https://syxui.dev/components/btn-follow
// Free in any project. Keep this line and credit syxUI where a person can read it.

import SwiftUI

let btnBlue = Color(red: 0.0, green: 0.47, blue: 1.0)

// Follow / Following toggle
struct FollowButtonCard: View {
    var body: some View {
        HStack(spacing: 12) {
            Text("Follow").font(.system(size: 15, weight: .semibold)).foregroundStyle(.white).frame(width: 120).padding(.vertical, 10).background(btnBlue, in: Capsule())
            HStack(spacing: 5) { Image(systemName: "checkmark"); Text("Following") }.font(.system(size: 15, weight: .semibold)).foregroundStyle(.primary).frame(width: 120).padding(.vertical, 10).overlay(Capsule().stroke(Color.primary.opacity(0.2), lineWidth: 1))
        }
    }
}
iOS 17 · No dependencies

Dependencies

SwiftUI
No external dependencies

Requires iOS 17