haze-patterns

Implement blur effects and UI patterns with the Haze library in Kotlin.

467|36|Updated Oct 28, 2025
One-click install
npx skills add https://github.com/Kototoro-app/Kototoro --skill haze-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: haze-patterns
Source: https://github.com/Kototoro-app/Kototoro/tree/main/.claude/skills/ui/haze-patterns
Command: npx skills add https://github.com/Kototoro-app/Kototoro --skill haze-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill provides expert guidance on implementing various UI patterns with the Haze library in Kotlin, including blurring effects, overlapping elements, and dialog management.

Core Features & Use Cases

  • Scaffold Blur: Implement blur effects on Scaffold components, such as top and bottom bars.
  • Dialog Blur: Apply blur to dialog backgrounds and overlay content.
  • Sticky Headers: Utilize sticky headers in LazyColumns for improved navigation.
  • Overlapping Cards: Create overlapping blurred cards with defined z-index levels.
  • Filtering Source Areas: Exclude specific layers from blur effects.
  • Deep Hierarchy Composition: Share blur states across nested composables efficiently.
  • Integrated Source and Effect: Apply source and effect on the same layout node.
  • Split-Window Position Strategy: Correctly align blur effects in split-screen modes.
  • Quick Start: Learn how to implement each pattern step-by-step.

Quick Start

To implement a dialog blur, start with the following code snippet in your Kotlin project:

val hazeState = rememberHazeState()
var showDialog by remember { mutableStateOf(false) }

// ... your existing content ...

if (showDialog) {
    Dialog(onDismissRequest = { showDialog = false }) {
        Surface(
            modifier = Modifier.fillMaxWidth().fillMaxHeight(0.5f),
            shape = MaterialTheme.shapes.extraLarge,
            color = MaterialTheme.colorScheme.surface.copy(alpha = 0.2f),
        ) {
            Box(Modifier.hazeEffect(state = hazeState) {
                blurEffect { style = HazeMaterials.regular() }
            }) {
                // Your dialog content here
            }
        }
    }
}

Frequently Asked Questions about haze-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement blur effects on Android Scaffold components like top and bottom bars using Kotlin?

To implement blur effects on Scaffold components in Kotlin, use the Haze library to apply hazeEffect modifiers to your top and bottom bars, allowing underlying content to show through with a blurred overlay.

Can I apply background blurring to dialogs and overlay content in Android?

Yes, you can apply background blurring to dialogs by wrapping your dialog content in a Surface with a low alpha color and applying the Haze library's hazeEffect with blurEffect to blur the underlying screen.

What's the best way to create overlapping blurred cards with defined z-index levels in Jetpack Compose?

The best way to create overlapping blurred cards is using the Haze library in Kotlin to apply blur effects to individual Card composables while managing their z-index levels for proper visual layering.

How do I exclude specific layers or filter source areas from blur effects in my Android UI?

You can exclude specific layers from blur effects by configuring the Haze library's filtering source areas, which allows you to selectively prevent designated composables from contributing to the blurred background output.

Does the Haze library support sharing blur states across deeply nested composables in Android?

Yes, the Haze library supports deep hierarchy composition by allowing you to share a single HazeState across multiple nested composables, ensuring consistent blur effects throughout complex UI trees.

How do I correctly align blur effects in split-screen or split-window modes on Android?

To correctly align blur effects in split-window modes, the Haze library provides specific position strategies to calculate window splits, ensuring the blur effect renders accurately across divided screen areas.