SP GlassKit1.1.0

GlassFloatingButton

Floating action placed inside the safe area, clear of the keyboard.

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

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

GlassFloatingButton 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-floating-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-floating-button
ModuleSPGlassComponents
Kindnative-wrapper — a prominent system glass button placed by an overlay inside the safe area
PlatformsiOS 26, iPadOS 26, macOS 26
ExampleExamples/Gallery/Buttons/GlassFloatingButtonExample.swift

Minimal usage

Swift
List(notes) { NoteRow($0) }
    .glassFloatingButton("New note", systemImage: "plus") { compose() }

Variants

VariantUse
Icon only (default)Circular button; the title is the accessibility label.
isExtended: trueCapsule showing the symbol and the title.
position.bottomTrailing (default), .bottomLeading, .bottomCenter, .topTrailing, .topLeading; leading and trailing follow the layout direction.

Parameters

ParameterTypeDefaultMeaning
titleKeyLocalizedStringKey—Title and accessibility label.
systemImageString—SF Symbol name.
positionGlassFloatingPosition.bottomTrailingCorner or edge inside the safe area.
isExtendedBoolfalseShows the title next to the symbol.
isPresentedBooltrueHides the button without removing the modifier.
action@MainActor () -> Void—Called on activation.

States

Appearing and disappearing use a scale and fade, or a fade alone with Reduce Motion. Pressed and focused states are drawn by the system.

Advanced example

Swift
ScrollView { content }
    .glassFloatingButton("Compose", systemImage: "square.and.pencil", position: .bottomCenter, isExtended: true, isPresented: !isSearching) {
        compose()
    }

Accessibility

  • The button always has a text label, visible or not.
  • It is laid out inside the safe area: it stays clear of the home indicator, of bars and of the software keyboard.
  • The hit target meets the platform minimum.
  • Do not make it the only way to reach an action: offer the same command in a menu or toolbar for keyboard and Switch Control users.

Limits

  • One floating button per screen. Several compete with each other and with the tab bar.
  • It floats over content and can hide the last row of a list; add bottom content margin where that matters.
  • GlassFloatingButton can also be used directly when a custom placement is needed.

Example

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

public struct GlassFloatingButtonExample: GlassExample {
    public static let componentID = "glass-floating-button"
    @State private var notes = ["Groceries", "Reading list", "Trip ideas"]
    @State private var isExtended = true

    public init() {}

    public var body: some View {
        List {
            Toggle("Show title", isOn: $isExtended)
            ForEach(notes, id: \.self) { Text($0) }
        }
        .frame(minHeight: 280)
        .glassFloatingButton("New note", systemImage: "plus", position: .bottomTrailing, isExtended: isExtended) {
            notes.append("Note \(notes.count + 1)")
        }
    }
}

#Preview("GlassFloatingButton") { GlassFloatingButtonExample() }

Registry entry

Identifierglass-floating-button
Version1.1.0
Depends onglass-components-support, glass-foundation
FrameworksSwiftUI
Public symbolsGlassFloatingPosition, GlassFloatingButton
LicenceMIT
Manifestmanifest.json

Files