Liquid glass, for Android.
A lens, not a blur.
Four things at the rim.
Bend
Near the edge, the glass reads what lies just outside it and pulls it in, eased so the middle stays calm.
Split
Red and blue are read a little apart along the edge's normal, the fringe real glass gives.
Mirror
The rim reflects what sits as far outside the edge as the point is inside it, and vivid colors bleed further in.
Light
A soft light on the side facing the light. On the phone it follows the tilt. Here it follows your pointer.
Hold them.
They turn to glass.
A few of PvotLib's components, rebuilt for the web on the same glass. The code under each is the real Compose API.
PvotNavBar
A glass bar whose chosen item grows into a pill.
PvotNavBar(
selectedTab = tab,
onTabClick = { tab = it },
tabs = tabs,
)
PvotSegmentedControl
Options in a capsule, the selection sliding between them.
PvotSegmentedControl( options = listOf("Day", "Week", "Month"), selectedIndex = range, onSelect = { range = it }, )
PvotSlider
Hold the knob and it lifts into a lens over the track.
PvotSlider(
value = brightness,
onValueChange = { brightness = it },
)
PvotSwitchRow
The knob turns to glass while you hold it.
PvotSwitchRow( title = "Bluetooth", checked = on, onCheckedChange = { on = it }, )
PvotGlassIconButton
Round glass for an icon floating over content, like the camera's controls.
PvotGlassIconButton(onClick = flip) { Icon(flipIcon, "Switch camera") }
PvotGlassCard
A card of glass, with a rim of light that follows the tilt.
PvotGlassCard(onClick = open) { Text("Next up") }
Pick the glass
by what sits on it.
The same words run behind all three. Clear lets them through, Regular softens them, Thick keeps text on top readable.
Clear
A faint haze. For icon-only controls, where nothing needs reading.
PvotGlassMaterial.Clear
Regular
A half-strength tint and a deeper blur. For bars, search fields, titled cards.
PvotGlassMaterial.Regular
Thick
Nearly opaque, the deepest blur. For sheets and dialogs with body text.
PvotGlassMaterial.Thick
No account.
No token.
PvotLib is published from its own repository. Add the Maven repo, then the libraries. It builds in AOSP too, as PvotDesignSystem.
settings.gradle.kts
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
maven("https://pvot-oss.github.io/PvotLib/maven") {
content { includeGroup("com.prauga.pvot") }
}
}
}
Glass over your content
val backdrop = rememberPvotGlassBackdrop() Box { LazyColumn(Modifier.pvotGlassBackdrop(backdrop)) { /* … */ } Box( Modifier .height(46.dp) .fillMaxWidth() .pvotGlass(backdrop) .pvotGlassRim() ) }