For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /dolan/glass.md.

Glass

Liquid Glass for the controls and bars that float over your content. One element draws Apple's glass on iOS 26, and the right fallback everywhere else.

Installation

npx @blotch/dolan add glass
import { UiGlass, UiGlassGroup } from '../components/ui/glass';
Tip

This also adds Icon, whose copy of the theme colors resolves the glass's tint.

Usage

Put ui-glass on a <blur-view>:

<blur-view ui-glass class="flex-row items-center gap-2 px-4 py-2">
  <ui-icon name="music" />
  <text class="text-glass-foreground">Now playing</text>
</blur-view>
  • The <blur-view> is the glass. Size it, place it and lay out its content with classes, as you would a <view>. It's the Lynx element that blurs, so import LYNX_ELEMENTS in your component.
  • Content goes inside it. On iOS, interactive glass only reacts to touches on itself and what's in it.
  • Color text with text-glass-foreground (and text-glass-muted-foreground). The glass points them at the right color for its variant and the user's contrast setting. <ui-icon>s inside get the same color.
  • Use glass sparingly, on the controls and bars that float above the content, never on the content itself. Don't put glass on glass.

What each platform draws

PlatformWhat you get
iOS 26 and laterLiquid Glass, drawn by iOS
iOS 15 to 25A blur material, Apple's design before Liquid Glass (see below)
AndroidAn opaque Material surface with a shadow, in the theme's secondary color
Android, with provideGlass() (below)A blur with a white sheen, a tint and a rim: glass without the refraction
Web previewLiquid Glass, drawn with WebGL

On Android, apps usually look like Android: Material 3 relies on color and shape rather than glass. To get glass there too, opt in for the whole app:

src/app/app.config.ts
import { provideGlass } from '../components/ui/glass';

export const appConfig: ApplicationConfig = {
  providers: [
    provideZonelessChangeDetection(),
    provideRenderer(),
    provideGlass({ android: 'glass' }),
  ],
};

Android's glass blurs live, with RenderEffect from Android 12. On older phones the blur costs more.

The Material design draws in your theme's colors. To draw it in the colors of the user's wallpaper, as other Android apps do, add Dynamic Color.

Variants

<blur-view ui-glass>…</blur-view>
<blur-view ui-glass variant="clear">…</blur-view>
  • regular (the default) frosts what's behind it. It suits most controls.
  • clear barely frosts it, for controls over photos and video. Text on it turns white.
  • Don't mix the two on one screen.

Clear glass over bright content needs a dark layer under it, at about a third, so the white stays legible. Put a bg-glass-dim view behind the glass:

<view class="h-[52px] w-[52px] rounded-full bg-glass-dim">
  <blur-view ui-glass variant="clear" shape="circle" class="h-[52px] w-[52px]">
    <ui-icon name="play" />
  </blur-view>
</view>

Shapes

<blur-view ui-glass shape="capsule">…</blur-view>
<blur-view ui-glass shape="circle" class="h-12 w-12">…</blur-view>
<blur-view ui-glass shape="rounded" [radius]="24">…</blur-view>
  • capsule (the default) has fully rounded ends, like most glass controls.
  • circle needs an equal width and height.
  • rounded has radius px corners, 20 by default.

A shape nested inside a rounded one looks right when its corners share the outer corners' centers. concentricRadius() works out its radius: the outer radius minus the gap between them.

import { concentricRadius } from '../components/ui/glass';

// A card inset 8px inside 24px glass corners gets 16px corners.
readonly innerRadius = concentricRadius(24, 8);

A capsule inset evenly inside a capsule is already concentric.

Tint

<blur-view ui-glass tint="var(--glass-tint)">
  <text class="text-glass-tint-foreground">Save</text>
</blur-view>
  • tint takes a theme token, such as var(--glass-tint), or any CSS color.
  • Keep it for the screen's main action. Color in glass controls should be rare.
  • Without glass, the tint fills the control, as a filled button does: on Android's Material surface, and on iOS 15 to 25's frosted material.

Interactive

<blur-view ui-glass interactive (bindtap)="play()">…</blur-view>

The glass swells and brightens under the finger, as iOS 26's glass controls do. It works on iOS 26 and in the web preview.

Materials before iOS 26

<blur-view ui-glass material="thin">…</blur-view>

iOS 15 to 25 has no Liquid Glass, so the glass draws one of UIKit's blur materials instead, as Apple's design of that time did. Apple gave each kind of control its own, and material picks it:

materialWhat it's for
ultra-thinThe most translucent: the most of what's behind stays in view
thinButtons floating over content
regular (default)Menus, popovers and alerts
thickThe most opaque: the most contrast for text and fine detail
chromeBars: tab bars, navigation bars and toolbars
  • The Dolan components pick theirs: chrome for the dock, navigation bar and toolbar, thin for glass buttons and button groups, and regular for menus, popovers and alert dialogs.
  • It follows your app's theme (see Dark mode). Clear glass draws the material's dark form in either theme, as Apple's controls over photos and video did.
  • Liquid Glass ignores it. iOS 26 and later, Android and the web preview draw the same glass for every material.
  • The materials come with the iOS app that ng build --platform ios builds. Lynx's own <blur-view> doesn't have them, so in Lynx Explorer the glass draws Lynx's older blur instead: white, or dark in dark mode and for clear glass.

Groups

ui-glass-group merges the glass inside it, as iOS draws a group of glass controls. Shapes closer than spacing px reach toward each other, and join into one once the gap between them is under half of it:

<blur-view ui-glass-group [spacing]="16" class="flex-row items-center gap-3">
  <blur-view ui-glass class="h-14 flex-1 flex-row">…</blur-view>
  <blur-view ui-glass shape="circle" class="h-14 w-14">…</blur-view>
</blur-view>
  • Put the glass directly inside the group. A wrapper that draws anything itself comes between them.
  • Shapes merge on iOS 26 and in the web preview. Android's glass doesn't merge.
  • Moving or resizing a shape morphs the glass with it, with a CSS transition for example.
  • Glass that comes and goes materializes and dissolves. A shape you add or remove (@if), or show and hide with visibility, fades in or out the way UIKit's glass does, and a change of tint or variant eases to the new one. That's on iOS 26, in the app ng build --platform ios builds: in Lynx Explorer, on Android and in the web preview the shape appears and disappears at once.

Morphing

Give two shapes the same glassId, and when one replaces the other, the group morphs the first into the second, as SwiftUI's glassEffectID does: here a button turns into the panel it opens, and back.

<blur-view ui-glass-group class="relative h-[200px]">
  @if (composing()) {
    <blur-view
      ui-glass
      shape="rounded"
      glassId="compose"
      class="absolute bottom-0 left-0 right-0 top-0 p-4"
    >
      …
    </blur-view>
  } @else {
    <blur-view
      ui-glass
      shape="circle"
      interactive
      glassId="compose"
      class="absolute bottom-0 right-0 h-14 w-14"
      (bindtap)="composing.set(true)"
    >
      …
    </blur-view>
  }
</blur-view>
  • Swap them in one update: remove or hide one shape and add or show the other, as @if and @else do.
  • In a group, the new shape grows out of the old one's frame and corners while the old one's glass flows into it, and the group merges the two as they move. The old content fades out and the new fades in.
  • Across groups or windows, such as a button in the page and a panel in an <overlay>, the new shape takes over where it is: it starts from the old one's corners, and the old content fades out over it. Place it where the old one was and grow it from there, as the menus, popovers and sheets do with a glass button.
  • It's iOS 26, in the app ng build --platform ios builds. Elsewhere one shape replaces the other at once, and under Reduce Motion the two cross-fade in place.

Dark mode

Glass follows the app's appearance, as the theme does: a light material in light mode and a dark one in dark mode. An app that stays light on a dark phone (provideColorScheme('light')) keeps light glass under its dark text.

API

UiGlass

Selector: blur-view[ui-glass].

InputTypeDefaultDescription
variant'regular' | 'clear''regular'Frosted glass, or clear glass for over media.
shape'capsule' | 'circle' | 'rounded''capsule'The glass's outline.
radiusnumber20Corner radius of a rounded shape, in px.
tintstring—A theme token (var(--glass-tint)) or a CSS color.
interactivebooleanfalseReacts to touch. iOS 26 and the web preview.
material'ultra-thin' | 'thin' | 'regular' | 'thick' | 'chrome''regular'The blur material before iOS 26 (see above).
glassIdstring—Pairs the shape with another to morph into (see Morphing).

Components built on the glass read these signals:

SignalTypeDescription
design'glass' | 'frosted' | 'material'The look on this platform (see GlassDesign), for the component's own form.
surface'glass' | 'frosted' | 'solid'What this glass draws, after the user's settings.
foregroundstringThe var() of the color for text and icons on it.

UiGlassGroup

Selector: blur-view[ui-glass-group].

InputTypeDefaultDescription
spacingnumber0How close two glass shapes come before they start to merge, in px. They join at half of it.

Functions

FunctionDescription
provideGlass({ android })App-wide options. android: 'glass' gives Android glass instead of Material.
injectGlassDesign()A signal of the platform's design, 'glass', 'frosted' or 'material', for a component's own form.
injectSystemDrawsGlass()true on iOS, which adapts its own glass to the user's settings.
concentricRadius(outer, inset)The corner radius for a shape inset px inside outer px corners.

Theme colors

TokenTailwind classesUsed for
glass-foreground / glass-muted-foregroundtext-glass-foreground, text-glass-muted-foregroundText and icons on glass
glass-clear-foregroundtext-glass-clear-foregroundText on clear glass, white in both themes
glass-tint / glass-tint-foregroundbg-glass-tint, text-glass-tint-foregroundTinted glass, and what sits on it
glass-dimbg-glass-dimThe dimming layer under clear glass

dolan add glass doesn't change your theme. A theme copied before these colors existed lacks them: run dolan update if you haven't edited it, and dolan doctor lists the lines to add if you have.

Accessibility

Glass follows the user's display settings, which LynxAccessibilitySettings reads:

  • Reduce Transparency turns the glass into a solid surface. iOS does this to its own glass. On Android and the web, the component draws the solid surface.
  • Increase Contrast makes muted text full strength, and gives the glass a solid edge on Android and the web. iOS adds its own edge.
  • Reduce Motion is for the components built on glass: they slide, minimize and morph less or not at all. iOS calms its own glass.

The apps ng build --platform makes send these settings. In Lynx Explorer, add them to the bundle URL to try them: ?reduceTransparency=true.