SP GlassKit1.1.0

GlassSplitButton

Primary action with a separate menu of secondary actions.

  • System control
  • iOS 26 · iPadOS 26 · macOS 26
  • Version 1.1.0
  • glass-split-button

Drawn by the system. GlassKit configures it and leaves the glass to the system.

GlassSplitButton running in SP Glass Studio.Capture
Capture of the component running in SP Glass Studio on the iOS 26.5 simulator. Liquid Glass is rendered by the system; this is an image, not a live preview.

Installation

spglass add glass-split-button

Copies the sources and their dependencies into your project. Set up the CLI.

Swift
.package(url: "https://git.spboucher.ai/sp-glasskit.git", from: "1.1.0")

import SPGlassKit
Identifierglass-split-button
ModuleSPGlassComponents
Kindnative-wrapper — Menu with a primary action on macOS; a glass button and a glass menu button on iOS and iPadOS
PlatformsiOS 26, iPadOS 26, macOS 26
ExampleExamples/Gallery/Buttons/GlassSplitButtonExample.swift

Minimal usage

Swift
GlassSplitButton("Send", systemImage: "paperplane") {
    send()
} menu: {
    Button("Send later…") { schedule() }
    Button("Save draft") { saveDraft() }
}

Variants

PlatformForm
macOSThe system split button: Menu(content:label:primaryAction:).
iOS, iPadOSTwo glass buttons in one glass container: the action, and a circular menu button. Each is its own accessibility element and hit target.

variant and size behave as for GlassButton.

Parameters

ParameterTypeDefaultMeaning
titleKeyLocalizedStringKey—Title of the primary action.
systemImageString?nilSF Symbol of the primary action.
variantGlassButtonVariant.regularVisual weight of both parts.
sizeGlassControlSize.regularControl size.
menuAccessibilityLabelLocalizedStringKey?"More actions" (localised)Name of the menu part.
action@MainActor () -> Void—Primary action.
menu@ViewBuilder—Menu content: buttons, sections, dividers.

States

Pressed, focused and menu-open states are drawn by the system. Disable the whole control with .disabled(_:); disable single menu items on the items themselves.

Advanced example

Swift
GlassSplitButton("Export", systemImage: "square.and.arrow.up", variant: .prominent, menuAccessibilityLabel: "Export options") {
    export(.pdf)
} menu: {
    Section("Format") {
        Button("PDF") { export(.pdf) }
        Button("PNG") { export(.png) }
    }
    Button("Export settings…") { showSettings() }
}

Accessibility

  • The action and the menu are two separate, labelled elements on iOS and iPadOS.
  • The menu part has its own name, "More actions" by default, in English and French.
  • Both parts meet the minimum hit target.
  • Menu items are standard buttons: VoiceOver, keyboard and Switch Control work as in any system menu.

Limits

  • On macOS the appearance is the system's split button and does not use a separate circular menu button.
  • Put the most frequent action first: the menu is for alternatives, not for the main path.

Example

Complete example (compiled with the package)
import SwiftUI
import SPGlassKit

public struct GlassSplitButtonExample: GlassExample {
    public static let componentID = "glass-split-button"
    @State private var lastAction = "Nothing sent yet"

    public init() {}

    public var body: some View {
        VStack(spacing: 16) {
            GlassSplitButton("Send", systemImage: "paperplane", variant: .prominent) {
                lastAction = "Sent now"
            } menu: {
                Button("Send later…", systemImage: "clock") { lastAction = "Scheduled" }
                Button("Save as draft", systemImage: "tray") { lastAction = "Saved as draft" }
            }
            Text(lastAction).font(.callout).foregroundStyle(.secondary)
        }
        .padding()
    }
}

#Preview("GlassSplitButton") { GlassSplitButtonExample() }

Registry entry

Identifierglass-split-button
Version1.1.0
Depends onglass-components-support, glass-foundation
FrameworksSwiftUI
Public symbolsGlassSplitButton
LicenceMIT
Manifestmanifest.json

Files