A SwiftUI wrapper of the new UIKit sheetPresentationController's capabilities in iOS15.

Overview

BottomSheet

Bring to SwiftUI the UIKit bottom sheet capabilities that came with iOS15.

Usage

Show the bottom sheet

Button(action: { show.toggle() }) {
    Text("Show!")
}
.bottomSheet(
    isPresented: $show,
    detents: .mediumAndLarge,
    shouldScrollExpandSheet: true,
    largestUndimmedDetent: .medium,
    showGrabber: true,
    cornerRadius: 20
) {
    List {
        Section {
            ForEach(0..<50, id: \.self) { id in
                Text("Item \(id)")
            }
        } header: {
            Text("Look at that bottom sheet!!")
        }
    }
}

Dismiss

Button(action: { BottomSheet.dismiss() }) {
    Label("Dismiss", systemImage: "multiply")
}

Preview

Bottom sheet

Sources

Inspired by Sarun W.'s article "How to present a Bottom Sheet in iOS 15 with UISheetPresentationController".

You might also like...
an extension library for SwiftUI sheets.

SheetKit SheetKit is an extension library for SwiftUI sheets. 中文版说明 with Picture What is SheetKit SheetKit is a library of extensions for SwiftUI moda

SwiftUI Draggable Bottom Sheet

SwiftUI Draggable Bottom Sheet

A SwiftUI Partial Sheet fully customizable with dynamic height
A SwiftUI Partial Sheet fully customizable with dynamic height

A SwiftUI Partial Sheet fully customizable with dynamic height

Native alert from Apple Music & Feedback. Contains Done, Heart & Message and other presets. Support SwiftUI.
Native alert from Apple Music & Feedback. Contains Done, Heart & Message and other presets. Support SwiftUI.

SPAlert Popup from Apple Music & Feedback in AppStore. Contains Done, Heart, Error and other presets. Supports Dark Mode. I tried to recreate Apple's

SwiftUI native-like onboarding sheets
SwiftUI native-like onboarding sheets

Welcome Sheet Welcome sheet for swiftUI enables incredibly easy way for creating onboarding screens, update notes, or whatever you imagine! The main i

DataDrivenAlert - Extension for SwiftUI.Alert for data driven configuration
DataDrivenAlert - Extension for SwiftUI.Alert for data driven configuration

Data driven alert and confirmation dialog Based on Composable Architecture Alert

Animated Alert written in SwiftUI.
Animated Alert written in SwiftUI.

TransactionAlert Animated Alert written in SwiftUI. Easy to use Get Started Add a TAViewModel instance as an environment object to your Root View in y

PageSheet - Customizable sheets using UISheetPresentationController in SwiftUI

PageSheet Customizable sheet presentations in SwiftUI. Using UISheetPresentation

AxisSheet for SwiftUI
AxisSheet for SwiftUI

It is a library that handles the sheet view in 4 directions (.top, .bottom, .leading, .trailing) according to the axis mode. It supports iOS and macOS.

Owner
Kaww
🍎
Kaww
JAlert - This is "Alert View" project for UIKit + SwiftUI. you can use easily

JAlert Example To run the example project, clone the repo, and run pod install from the Example directory first. Requirements Installation JAlert is a

Jackson 3 Feb 22, 2022
A Swift Toast view - iOS 14 style and newer - built with UIKit. 🍞

Toast-Swift A Swift Toast view - iOS 14 style - built with UIKit. ?? Installation Swift Package Manager You can use The Swift Package Manager to insta

Bastiaan Jansen 216 Jan 4, 2023
Swift Package mimicking UIKit's ActionSheet with added features

ActionSheetController A Swift package that mimics the UIAlertController Actionsheet with added features. ActionSheetController gives you the ability t

Adebiyi Mojisola 5 Sep 4, 2021
(Experimental libraries) Controls interrupt handling, such as alert views, and is compatible with UIKit and Swift UI.

UIPresentCoordinator Controls interrupt handling, such as alert views, and is compatible with UIKit and Swift UI. This library manages items that are

Yuki Tamazawa 1 Jan 22, 2022
Swifty, modern UIAlertController wrapper.

Alertift Alertift.alert(title: "Alertift", message: "Alertift is swifty, modern, and awesome UIAlertController wrapper.") .action(.default("❤️"))

Suguru Kishimoto 287 Jan 7, 2023
Toasts and popups library written with SwiftUI

Popup View Toasts and popups library written with SwiftUI We are a development agency building phenomenal apps. Usage Put all your body code into a ZS

Exyte 1.9k Jan 5, 2023
BottomSheet makes it easy to add custom bottom sheets to your SwiftUI apps.

BottomSheet About BottomSheet BottomSheet makes it easy to add custom bottom sheets to your SwiftUI apps. The result can look like this...or completel

Daniel Saidi 174 Jan 2, 2023
Easily create different alerts in SwiftUI

AlertWizard ????‍♂️ This package lets you easily create different alerts in SwiftUI with the call of a single function. As this is my first package th

null 3 Jun 3, 2021
Bursts 🔥 A Funny Framework is showing alerts, Have been Adapting Swift and SwiftUI

Bursts ?? A Funny Framework is showing alerts, Have been Adapting Swift and SwiftUI Features iOS 10+ Can be used in UIKit and SwiftUI applications Lig

Jovins 11 Apr 22, 2022
Create Apple-like alerts & toasts using SwiftUI

AlertToast-SwiftUI Present Apple-like alert & toast in SwiftUI ?? Example ?? Overview Currently in SwiftUI, the only way to inform the user about some

Elai Zuberman 1.1k Dec 29, 2022