Skip to content

Materials

We provide off of the shelf implementations of HazeStyles which implement 'materials' of various styles.

DownloadΒΆ

Maven Central

repositories {
    mavenCentral()
}

dependencies {
    implementation("dev.chrisbanes.haze:haze-materials:<version>")
}

HazeMaterialsΒΆ

A class which contains functions to build HazeStyles which implement 'material-like' styles. It is inspired by the material APIs available in SwiftUI, but it makes no attempt to provide the exact effects provided in iOS (unlike CuperintoMaterials below).

Class reference: HazeMaterials.

CupertinoMaterialsΒΆ

A class which contains functions to build HazeStyles which implement 'material' styles similar to those available on Apple platforms. The values used are taken from the iOS 18 Figma file published by Apple.

The primary use case for using these is for when aiming for consistency with native UI (i.e. for when mixing Compose Multiplatform content alongside SwiftUI content).

Class reference: CupertinoMaterials.

FluentMaterialsΒΆ

These implement 'material' styles similar to those available on Windows platforms. The values used are taken from the WinUI 3 Figma file published by Microsoft.

The primary use case for using these is for when aiming for consistency with native UI (i.e. for when mixing Compose Multiplatform content alongside WinUI content).

Class reference: FluentMaterials.

UsageΒΆ

All of these are provided through functions on the relevant materials class, with each function providing a different level of material.

Box {
  // rest of sample from above

  LargeTopAppBar(
    modifier = Modifier
      .hazeChild(
        ...
        style = HazeMaterials.thin(),
      ),
  )
}