Blur & Glassmorphism Effects: RenderEffect and Frosted Glass UI
Modern UI designs often use blur effects and glassmorphism for depth and visual hierarchy.
Blur with RenderEffect (Android 12+)
Box(
modifier = Modifier
.fillMaxWidth()
.height(200.dp)
.graphicsLayer {
renderEffect = BlurEffect(
radiusX = 10f,
radiusY = 10f,
edgeTreatment = TileMode.Clamp
)
}
)
Glassmorphism Pattern
@Composable
fun GlassCard(content: @Composable () -> Unit) {
Box(
modifier = Modifier
.fillMaxWidth()
.background(
color = Color.White.copy(alpha = 0.1f),
shape = RoundedCornerShape(12.dp)
)
.border(
width = 1.dp,
color = Color.White.copy(alpha = 0.2f),
shape = RoundedCornerShape(12.dp)
)
.padding(16.dp)
) {
content()
}
}
Semi-Transparent Overlay
Box(
modifier = Modifier
.fillMaxSize()
.background(Color.Black.copy(alpha = 0.4f))
)
Blur and glassmorphism effects create modern, polished UIs that improve visual communication and guide user attention effectively.
8 Android app templates available on Gumroad
Top comments (0)