SP GlassKit1.1.0

GlassSheet

System sheet with detents, keyboard handling and an accessible close action.

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

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

GlassSheet 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-sheet

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-sheet
ModuleSPGlassComponents
Kindnative-wrapper — the system .sheet; the system draws the sheet and its glass
PlatformsiOS 26, iPadOS 26, macOS 26
ExampleExamples/Gallery/Containers/GlassSheetExample.swift

Minimal usage

Swift
.glassSheet(isPresented: $showsFilters, title: "Filters") {
    FiltersForm()
}

Variants

VariantUse
isPresented:Presentation driven by a Boolean.
item:Presentation driven by an optional Identifiable value.
.standardFull height, drag indicator, close button.
.halfAndFullRests at half height, can be pulled to full height.
Custom detents.medium, .large, .fraction(0.1...1), .height(≥ 44).

Parameters

ParameterTypeDefaultMeaning
isPresented / itemBinding<Bool> / Binding<Item?>—Presentation state.
titleLocalizedStringKey?nilTitle of the sheet's bar.
configurationGlassSheetConfiguration.standardOptions below.
onDismiss(@MainActor () -> Void)?nilCalled after dismissal.
content@ViewBuilder—Content of the sheet.

GlassSheetConfiguration:

FieldDefaultMeaning
detents[.large]Resting heights; an empty list means full height. Out-of-range values are normalised.
showsDragIndicatortrueDrag indicator visibility.
showsCloseButtontrueSystem close button (ButtonRole.close) in the bar.
isInteractiveDismissDisabledfalseBlocks swipe-to-dismiss; the close button still works.
scrollDismissesKeyboardtrueScrolling inside the sheet dismisses the keyboard interactively.

States

Presented or not, owned by the host. The current detent is managed by the system.

Advanced example

Swift
.glassSheet(item: $editedContact, title: "Edit contact",
            configuration: GlassSheetConfiguration(detents: [.fraction(0.45), .large], isInteractiveDismissDisabled: hasChanges)) { contact in
    ContactForm(contact: contact)
        .toolbar {
            ToolbarItem(placement: .confirmationAction) { Button("Save") { save(contact) } }
        }
}

Accessibility

  • The close button uses the system close role: the system provides its symbol and its localised label, and it sits in the cancellation placement where assistive technologies expect it.
  • The title is a navigation title, announced as a heading.
  • Keyboard avoidance, focus trapping and the Escape key are the system's.
  • With isInteractiveDismissDisabled, keep showsCloseButton on (or provide your own way out) so the sheet can always be left.

Limits

  • When a title or the close button is requested, the content is wrapped in a NavigationStack so that it can also add toolbar items. Pass title: nil and showsCloseButton: false to present the content bare.
  • GlassKit adds no background: at partial height the system draws the Liquid Glass sheet. Do not add a glass surface inside.
  • Detents have no effect on macOS, where sheets are sized by their content.
  • The mapping to PresentationDetent is tested; the presentation itself was compiled for iOS and macOS but not exercised in a running application by the automated tests.

Example

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

public struct GlassSheetExample: GlassExample {
    public static let componentID = "glass-sheet"
    @State private var showsFilters = false
    @State private var showsTerms = false
    @State private var keyword = ""
    @State private var onlyAvailable = true

    public init() {}

    public var body: some View {
        VStack(spacing: 16) {
            GlassButton("Filters", systemImage: "line.3.horizontal.decrease") { showsFilters = true }
            GlassButton("Terms of use") { showsTerms = true }
        }
        .padding()
        .glassSheet(isPresented: $showsFilters, title: "Filters", configuration: .halfAndFull) {
            Form {
                TextField("Keyword", text: $keyword)
                Toggle("Only available", isOn: $onlyAvailable)
            }
        }
        .glassSheet(
            isPresented: $showsTerms,
            title: "Terms of use",
            configuration: GlassSheetConfiguration(detents: [.fraction(0.4), .large], isInteractiveDismissDisabled: true)
        ) {
            ScrollView {
                Text("Sample terms. This sheet cannot be swiped away: the close button is the way out.")
                    .frame(maxWidth: .infinity, alignment: .leading)
                    .padding()
            }
        }
    }
}

#Preview("GlassSheet") { GlassSheetExample() }

Registry entry

Identifierglass-sheet
Version1.1.0
Depends onglass-foundation
FrameworksSwiftUI
Public symbolsGlassSheetDetent, GlassSheetConfiguration
LicenceMIT
Manifestmanifest.json

Files