hazeGlass

fun Modifier.hazeGlass(input: HazeInput, style: GlassStyle = GlassStyle, performanceMode: HazePerformanceMode? = null, expandLayerBounds: Boolean = true, interactionSource: InteractionSource? = null, interactionTransformTarget: GlassTransformTarget = GlassTransformTarget.MaterialOnly, interactionTransformPivot: GlassTransformPivot = GlassTransformPivot.Pointer, interactionReducedMotionPolicy: GlassReducedMotionPolicy = GlassReducedMotionPolicy.System, memberTransition: GlassMemberTransition = GlassMemberTransition.MatchedGeometry, groupKey: Any? = null): Modifier

Draws a Glass material using an explicit Haze input.

style is a sequence of appearance writes. Each time this node resolves its style, Haze initializes a fresh Regular response for the current system appearance, then runs LocalGlassStyle → style into it, so the same Style may be shared by concurrent nodes. Each node independently owns and animates the declared hover, focus, and press responses.

Snapshot state read by a Style block is observed by this node: a change resolves the Style again and redraws on the next frame without recomposition. Styles compare by identity, so remember or hoist style. Invalid values throw IllegalArgumentException when the block runs. Built-in Regular and Clear material responses update when the Compose host's system appearance changes. Inside hazeGlassContainer, material output sits behind all container children and Backdrop samples only drawing before that container. Each member still evaluates its own style here.

input, performanceMode, expandLayerBounds, interactionSource, interactionTransformTarget, interactionTransformPivot, and interactionReducedMotionPolicy are node-owned modifier mechanics rather than Style presentation. Recomposition replaces each value completely, including a null interaction source.

Parameters

input

Source-backed content, this modifier's own content, or an experimental Android window backdrop with an optional source fallback. Without a fallback, unavailable or failed native backdrop draws content unchanged and does not demand source capture.

style

Explicit appearance applied after defaults and LocalGlassStyle.

performanceMode

Rendering-fidelity policy, or null to inherit LocalHazePerformanceMode. The default selects the fixed Balanced profile. Named and fixed modes select a normalized, deterministic profile.

expandLayerBounds

Whether Glass may expand its capture layer for optical sampling.

interactionSource

Optional external interaction source owned by this modifier node.

interactionTransformTarget

Visual layers that receive the interaction scale transform.

interactionTransformPivot

Pivot used by the interaction scale transform.

interactionReducedMotionPolicy

Motion policy for this node's Style responses.

memberTransition

How this member's glass enters and leaves its hazeGlassContainer. It is ignored outside a container. Haze animates only the glass, so animate member content yourself, for example with AnimatedVisibility.

groupKey

Groups this member with others in the same hazeGlassContainer. Members with an equal (==), non-null key that are consecutive in registration order draw as one Glass shape over the bounding box of their rects, at any distance, and attach to or detach from each other at any distance. null leaves the member ungrouped. It is ignored outside a container.