Configuring and Personalizing

Adjust appearance and behavior of MaterialUIKit components using MUIKitConfiguration.

Overview

Configure and personalize MaterialUIKit components to fit your app’s design. Utilize the MUIKitConfiguration to adjust layout, spacing, animation, and haptic feedback settings. Default settings can be adjust and applied globally, or individual properties can be fine-tuned as needed.

Customize an Individual Properties

To modify specific properties like borderWidth, you can adjust the configuration directly in your app initialization.

@main
struct MyApp: App {
    init() {
        // Customize individual properties
        MaterialUIKit.configuration.borderWidth = 2.0
        MaterialUIKit.configuration.hapticFeedbackIntensity = 1.0
    }
}

Apply a Custom Configuration

To apply a custom configuration globally, set the MaterialUIKit.configuration property with your custom MUIKitConfiguration instance during an app initialization.

@main
struct MyApp: App {
    // Create an instance of the MUIKitConfiguration
    let customConfiguration = MUIKitConfiguration()

    init() {
        MaterialUIKit.configuration = customConfiguration
    }
}

To customize these settings, refer to the available configuration properties MUIKitConfiguration.

Last updated