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
  • Initializer
  • Parameter
  • Example
  1. Components

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)
}
PreviousCollectionStyleNextDate Selector

Last updated 10 months ago