Container

Represents a Material UI styled container that wraps and aligns its child elements.

Overview

The Container provides an empty view container with default MaterialUIKit styling. It wraps any provided content within a styled background with consistent padding and spacing as defined by the configuration settings. For more information about configuration settings refer toMUIKitConfiguration

To use the Container, initialize it with a closure that returns the content to be displayed within the container.

Do not use Container with NavigationContainer, as the latter already includes a default configuration for styling and layout.

Initializer

Creates an empty container view.

Container(@ViewBuilder content: () -> Content)

Parameter

Parameter
Description

content

The content to be wrapped in the container view.

Example

Container {
    Text("Hello, World!")
        .font(MaterialUIKit.configuration.h1)
        .foregroundColor(.materialUIPrimaryTitle)
}

Last updated