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 split button with a dropdown.

Navigation · SwiftUI · iOS 17

  • navigation
  • swiftui

The actual source

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

import SwiftUI

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

struct MenuSplitButton: View { var body: some View { HStack(spacing: 0) { Text("Save").font(.system(size: 15, weight: .semibold)).foregroundStyle(.white).padding(.horizontal, 20).padding(.vertical, 11).background(mnBlue); Rectangle().fill(.white.opacity(0.3)).frame(width: 1, height: 42); Image(systemName: "chevron.down").font(.system(size: 12, weight: .bold)).foregroundStyle(.white).padding(.horizontal, 12).padding(.vertical, 11).background(mnBlue) }.clipShape(RoundedRectangle(cornerRadius: 12, style: .continuous)) } }
iOS 17 · No dependencies

Dependencies

SwiftUI
No external dependencies

Requires iOS 17