MaterialUIKit
Github
  • MaterialUIKit
  • Essentials
    • Configuring and Personalizing
    • Defining a Custom Color Schemes
  • Configuration and Color Schemes
    • MUIKitConfiguration
    • MUIKitColorScheme
  • Components
    • Action Button
      • ActionButtonStyle
    • Checkbox
    • Collection
      • CollectionStyle
    • Container
    • Date Selector
    • Dialog
    • Dialog Sheet
    • Dropdown Menu
      • Dropdown Menu Label
    • FAB
    • Icon Button
      • IconButtonStyle
    • Navigation Container
      • NavigationContainerHeaderStyle
      • Navigation Route
      • Navigation Route Label
    • Progress Bar
    • Radio Buttons Group
    • Search Box
    • Secure Text Box
    • Segmented Buttons
    • Separator
      • SeparatorOrientationStyle
    • Snackbar
    • Switch
    • Time Selector
    • Text Box
    • Tab Bar
      • TabBar Item
Powered by GitBook
On this page
  • Overview
  • Modifer
  • Parameters
  • Example
  1. Components

Dialog Sheet

Represents a Material UI styled modal sheet for presenting supplementary content or actions.

Overview

Dialog sheets provide a way to present content that needs user attention, such as forms, detailed information, or additional actions.

The dialogSheet modifier allows you to display a Material Design styled dialog sheet from any SwiftUI view. It lets you customize the content that appears in the dialog sheet.

To use the dialogSheet modifier, apply it to any View with the required parameters.

Modifer

Presents a simple dialog sheet over the current view.

dialogSheet(isPresented: Binding<Bool>, _ content: @escaping () -> Content)

Parameters

Property
Description

isPresented

A Binding<Bool> to control the presentation state of the dialog sheet.

content

A closure returning the view content to be displayed in the dialog sheet.

Example

@State private var showDialogSheet = false

var body: some View {
    Container {
        Switch("Show Dialog Sheet", isOn: $showDialogSheet)
    }
    .dialogSheet(isPresented: $showDialogSheet) {
        VStack(alignment: .leading, spacing: 15) {
            Text("Dialog Sheet")
                .font(MaterialUIKit.configuration.h4)
                .fontWeight(.bold)
            
            Text("It can contain any custom content.")
                .font(MaterialUIKit.configuration.h4)
        }
    }
}
PreviousDialogNextDropdown Menu

Last updated 10 months ago