Recommendation
Use Haze in the optional asgard-glass add-on. Register the background once and apply frost to each chosen component. Lens refraction remains a future experiment.
Glass earns its place where a control floats over content that moves beneath it. Frost softens background detail so the label stays readable. Refraction also bends that detail near the edges. A bar over an empty scaffold inset has little to sample. Place the feed behind the bar and reserve enough scroll padding to reach the last item. Apple’s material guidance likewise places glass in a distinct layer for navigation and controls. Apple material guidance
Asgard already gets its colors, shapes and typography from the host’s Material theme. Keep that contract. Installing the add-on should only make glass available. Each component instance explicitly selects it, and the host can turn it off for accessibility or by user preference. The core artifact can continue to ship without a renderer dependency. Asgard library contract
Renderer comparison
All three libraries publish Android and Wasm variants under Apache 2.0. Haze is the best fit for starting with frost and adding a lens later through the same source registration. Repository stars below are rounded adoption signals observed on 22 November 2026.
Haze 2.1.0
≈2.7k GitHub starsFirst choice. Core tracks source layers. Separate haze-blur and haze-glass modules provide frost and refraction. The 2.1.0 artifacts declare Kotlin 2.4.21 and Compose 1.12.2. A sample using both modules compiled with Asgard’s newer Compose pin. Ship core and blur for the first style, then add the glass module when the lens is ready.
Backdrop 2.0.1
≈4.7k GitHub starsBest alternative for bespoke optics. Kyant’s io.github.kyant0:backdrop provides composable blur, lens, highlights and layer backdrops. Android blur requires API 31 and the lens requires API 33. Its 2.x line publishes both Asgard targets. It suits a team that wants to art-direct the material and own its presets and fallbacks.
Liquid 1.1.1
≈580 GitHub starsFocused lens alternative. FletchMcKee’s liquid pairs an explicit source with an effect modifier and offers shader-driven distortion. It publishes the required variants. Its metadata targets Kotlin 2.3.0 and Compose 1.10.0, a wider version gap to exercise if Asgard chooses this engine.
Compose alone
Built-in fallbackA theme-colored fill and outline are cheap and predictable on every Asgard target. Compose’s Modifier.blur() softens the contents of its own layer, including any text drawn there. Backdrop frost needs a separately sampled background with sharp controls drawn over it. Building that pipeline in Asgard would also make Asgard responsible for capture, coordinates and platform differences.
Platform behavior
The current checkout targets Android API 28+ and Kotlin/Wasm in the browser, with Kotlin 2.4.21, Compose Multiplatform and Material 3 1.13.0-alpha02, and Android compile SDK 37.2. A renderer’s platform list is broader than Asgard’s published variants. Library targets · Version catalog
| Target | Current treatment | Implementation decision |
|---|---|---|
| Android 28–30 | Opaque themed surface | Haze Blur defaults to a scrim here. Choose the host’s solid container and skip capture and experimental legacy blur. |
| Android 31–32 | Opaque themed surface | API 31 can recapture sources on unrelated snapshot changes. Keep this tier solid pending physical-device profiling. |
| Android 33+ | Hardware-accelerated frost | Accelerated windows sample the backdrop. Software-rendered windows use a solid themed fill. |
| Browser Wasm | Frosted | Haze samples the backdrop through Skia. The browser’s reduced-transparency preference selects a solid surface. |
| iOS / macOS | Future Asgard targets | First add, publish and test an iOS or macOS target. macOS via desktop JVM is a separate packaging choice from native macOS Arm64. Haze offers variants for both. Native Apple Liquid Glass would require a separate interop decision. |
Haze platform behavior Blur targets Android runtime shaders Apple framework adoption
Opt-in API
Register the image or scrolling content with asgardGlassSource. Put a glass modifier on each chosen control. This example uses an app-provided photo and tap handler. The card keeps its own text colors and click handling.
val shape = MaterialTheme.shapes.large
val fill = MaterialTheme.colorScheme.surfaceContainer
val source = rememberAsgardGlassSource(enabled = glassCard && !reduceTransparency)
Box {
Photo(Modifier.matchParentSize().asgardGlassSource(source))
AsgardStatCard(
label = "Voltage", value = "5.00", unit = "V",
modifier = Modifier.asgardGlass(source, enabled = glassCard, shape = shape, containerColor = fill),
shape = shape,
containerColor = if (glassCard) Color.Transparent else fill,
onClick = openVoltageDetails,
)
}
Where to place the effect
The source records just the background subtree, such as the scrolling list. The overlay samples that source in the same coordinate space, clips and tints it inside its resolved container shape, then draws icons and labels above it. Keep overlays outside their own source and share one recording across the chosen surfaces. A missing or disabled source uses the ordinary Material fill. Haze core concepts
What belongs in each artifact
Core Asgard exposes a container slot on the toolbar and configured navigation bar. It draws inside the control’s shape and insets. The add-on supplies source.frosted(enabled), Modifier.asgardGlass, and AsgardGlassSurface for content slots. Applications using core alone can keep their current dependencies.
Component compatibility
In the Android or browser gallery, choose Browse → component → Preview glass. Each entry remembers its own switch as you browse. For a modal, turn on the preview and then open the sheet or dialog.
Scores describe design fit and integration effort. A 5 has a natural glass container. A 4 needs explicit shape, color or state handling. A 3 depends on content or density. A 2 favors a surrounding surface or in-window slot. A 1 keeps the component’s own visual effect and uses glass only behind it. Device performance is assessed separately.
View all 44 component ratings
| Component | Score | How to apply glass |
|---|---|---|
| AsgardActionItem | 4/5 | Frost the action tile and keep its icon and caption legible through the press animation. |
| AsgardActionSheet | 2/5 | Put the source and frosted message inside the sheet window. Keep footer actions readable. |
| AsgardActionToolbar | 5/5 | Use the container overload to share one backdrop across the toolbar actions. |
| AsgardAnimatedNumeral | 3/5 | Draw a glass plate behind the numeral so its changing digits stay sharp. |
| AsgardAvatar | 3/5 | Frost an initials or icon fill. An opaque photograph can use a glass frame. |
| AsgardBadge | 4/5 | Match the pill shape, clear the badge fill and preserve the outline and text color. |
| AsgardBanner | 4/5 | Use the banner shape and semantic tint. A custom gradient must leave the backdrop visible. |
| AsgardCalendarHeatmap | 2/5 | Use one plate under the grid and retain distinct colors for missing, zero and selected dates. |
| AsgardChartLegend | 4/5 | Frost the legend container once and keep all series swatches opaque. |
| AsgardDialogScaffold | 2/5 | Use an in-window source for the dialog body and preserve the modal scrim. |
| AsgardEmptyState | 4/5 | Use a bounded surface behind the empty-state icon and message. |
| AsgardFeatureRow | 4/5 | Apply frost beneath the row and keep the feature icon badge distinct. |
| AsgardGlassSurface | 5/5 | Pass the shared source and place custom content inside this shaped surface. |
| AsgardHeader | 5/5 | Frost a pinned header over scrolling content and retain the host's title and action colors. |
| AsgardLabeledSlider | 3/5 | Frost the group behind the slider while retaining the track, thumb and value colors. |
| AsgardLazyScrollbar | 2/5 | Use a plate for the scroll area and preserve the thumb contrast and drag target. |
| AsgardLegendItem | 4/5 | Place the label and swatch together on one small plate. |
| AsgardLineChart | 2/5 | Use a single chart plate and keep plotted lines, axes and data labels sharp. |
| AsgardListRow | 3/5 | Select individual rows or one shared list container. Measure fast scrolling with repeated effects. |
| AsgardLoadingState | 3/5 | Frost the caption and spinner container, leaving the progress indicator distinct. |
| AsgardLockedOverlay | 1/5 | Preserve the lock scrim and input interception. Put optional frost on the supporting content. |
| AsgardNavigationBar | 5/5 | Use the configured bar's container slot so the floating margin stays clear. |
| AsgardNavigationRail | 4/5 | Match the rail bounds and clear its fill. Retain the selected destination indicator. |
| AsgardOnboardingScaffold | 3/5 | Keep the onboarding surface bounded and check long text over the brightest background. |
| AsgardPicker | 3/5 | Place one surface behind the picker and keep its search, item labels and selection readable. |
| AsgardPickerSheet | 2/5 | Place the backdrop and picker together inside the sheet body. |
| AsgardProBadge | 4/5 | Retain the premium tint and its matching foreground on a pill-shaped surface. |
| AsgardProgressRing | 2/5 | Keep the ring stroke and progress label sharp over a supporting plate. |
| AsgardPulseRing | 2/5 | Leave the animated pulse in the foreground and use frost on its supporting surface. |
| AsgardSearchBar | 4/5 | Keep the field outline, cursor, placeholder and error state legible over the fill. |
| AsgardSectionCard | 5/5 | Frost the card once, clear its internal fill and share the background across its rows. |
| AsgardSettingRow | 4/5 | Use a bounded row surface and retain contrast for both the label and trailing value. |
| AsgardSettingToggleRow | 4/5 | Keep the switch track, thumb and checked state independent of the row background. |
| AsgardSheet | 2/5 | Put a bounded source inside the sheet and frost the selected content slot. |
| AsgardShimmer | 1/5 | Preserve the skeleton animation. Use glass only for its supporting surface. |
| AsgardStackedBarChart | 2/5 | Draw one plate beneath the plot and preserve segment colors and axis labels. |
| AsgardStatCard | 5/5 | Match the card shape, make the card fill transparent and retain label and value colors. |
| AsgardStatTile | 5/5 | Frost an individual tile while keeping the number, icon and status dot sharp. |
| AsgardStepperRow | 4/5 | Use one surface behind the value and controls and retain their disabled states. |
| AsgardTimelineBar | 2/5 | Use a supporting plate and preserve the segment boundaries and time encoding. |
| AsgardTonalIconButton | 4/5 | Match the button shape and clear its active fill while keeping a contrasting icon. |
| AsgardUpgradeCard | 4/5 | Keep the call-to-action colors explicit when replacing the promotional card fill. |
| ConnectedButtonGroup | 3/5 | Frost the group once and retain opaque checked indicators and distinct disabled segments. |
| StatusChip | 4/5 | Use a pill-shaped background and retain the status label and foreground color. |
Evidence & release checks
Asgard 2.2.0 includes per-component previews and a shared rating table used by both galleries and the Asgard skill. The implementation guide gives the current API and Android fallback policy. Glass UI integration guide
- 1. Exercise the same scene in both galleries.
- Use the shared gallery’s glacier scene to exercise scrolling beneath the toolbar and floating bar. Independently toggle each surface and switch to the solid fallback. Check rest, fast scroll, route changes, RTL, resizing and clipped custom shapes. An area outside the selected surface should match the solid baseline. Existing gallery harness
- 2. Check legibility against the worst backdrop.
- Try bright photos, dark photos and dense text in both host themes. Measure the composited pixels behind labels. Target 4.5:1 for ordinary text, 3:1 for large text and 3:1 for required control boundaries or state indicators. Use explicit host content colors and a stronger tint or opaque fill when needed. Honor reduced transparency through an app preference and available platform signals. Disable optional animated highlights under reduced motion. Check focus, TalkBack, touch targets and 200% text scaling in both modes. Text contrast · Non-text contrast
- 3. Measure cost per selected surface.
- Compare the same scrolling workload with zero, one and two glass surfaces on physical Android devices spanning the three API tiers and in the Wasm gallery. Record frame-time percentiles, missed deadlines, GPU time where available, memory and artifact size. Agree a regression budget against the plain baseline before shipping. Profile API 31 during an unrelated animation. If a tier misses its budget, ship the solid fallback there. Asgard’s existing emulator measurements cover other components. Asgard benchmark method · Haze performance guidance
- 4. Verify the published consumer paths.
- Resolve core alone and confirm its dependency graph excludes Haze. Resolve the add-on from a test Maven repository on both targets. Run the compatibility fixture and extend it with a toolbar and configured navigation call compiled against 2.1.1. Ship frost when these checks pass. Evaluate lens distortion against the same scenes and budget before exposing it. Existing compatibility fixture