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

Split Button

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

A self-contained split button — SwiftUI, styled from system tokens.

Buttons · SwiftUI · iOS 17

  • buttons
  • swiftui

The actual source

SplitButtonCard.swift
// Split Button · syxUI · https://syxui.dev/components/button-split
// Free in any project. Keep this line and credit syxUI where a person can read it.

import SwiftUI

// Split button (primary + caret menu)
struct SplitButtonCard: View {
    var body: some View {
        HStack(spacing: 0) {
            Text("Publish").font(.system(size: 16, weight: .semibold)).foregroundStyle(.white).frame(maxWidth: .infinity, minHeight: 52)
            Rectangle().fill(.white.opacity(0.2)).frame(width: 1, height: 28)
            Image(systemName: "chevron.down").font(.system(size: 14, weight: .semibold)).foregroundStyle(.white).frame(width: 52, height: 52)
        }.background(Color.primary, in: RoundedRectangle(cornerRadius: 16, style: .continuous))
    }
}
iOS 17 · No dependencies

Dependencies

SwiftUI
No external dependencies

Requires iOS 17