Glass Button
Frosted glass effect with backdrop blur and subtle transparency
Embed this component
Paste this snippet into any site — the design renders in a sandboxed iframe served from /embed/glass-button.
<iframe src="/embed/glass-button" sandbox="allow-scripts" loading="lazy" title="Glass Button" style="border:0;width:100%;height:480px;overflow:hidden"></iframe>Implementation code
Copy the HTML and CSS for Glass Button, or grab a framework-specific implementation. The HTML and CSS variants are self-contained; framework variants assume that framework's project setup.
HTML
<div class="glass-container">
<div class="glass-bg-orb glass-bg-orb-1"></div>
<div class="glass-bg-orb glass-bg-orb-2"></div>
<button class="glass-button">Glass Button</button>
</div>CSS
.glass-container {
position: relative;
padding: 2rem;
border-radius: 1rem;
background: linear-gradient(135deg, #667eea, #764ba2, #f093fb);
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
}
.glass-bg-orb {
position: absolute;
border-radius: 50%;
filter: blur(40px);
opacity: 0.6;
}
.glass-bg-orb-1 {
top: 1rem;
left: 1rem;
width: 5rem;
height: 5rem;
background: #fbbf24;
}
.glass-bg-orb-2 {
bottom: 1rem;
right: 1rem;
width: 6rem;
height: 6rem;
background: #22d3ee;
}
.glass-button {
position: relative;
padding: 1rem 2rem;
border-radius: 0.75rem;
background: rgba(255, 255, 255, 0.2);
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
border: 1px solid rgba(255, 255, 255, 0.3);
color: white;
font-weight: 600;
cursor: pointer;
transition: all 0.3s ease;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}
.glass-button:hover {
background: rgba(255, 255, 255, 0.3);
transform: scale(1.05);
box-shadow: 0 8px 32px rgba(168, 85, 247, 0.2);
}
.glass-button:focus {
outline: 2px solid rgba(168, 85, 247, 0.5);
outline-offset: 2px;
}Tailwind CSS
<div class="relative p-8 rounded-2xl overflow-hidden bg-gradient-to-br from-indigo-500 via-purple-500 to-pink-500">
<div class="absolute top-4 left-4 w-20 h-20 rounded-full bg-yellow-400 blur-2xl opacity-60"></div>
<div class="absolute bottom-4 right-4 w-24 h-24 rounded-full bg-cyan-400 blur-2xl opacity-60"></div>
<button class="relative px-8 py-4 rounded-xl bg-white/20 backdrop-blur-xl border border-white/30 text-white font-semibold hover:bg-white/30 hover:scale-105 transition-all shadow-lg">
Glass Button
</button>
</div>React
function GlassButton() {
return (
<>
<style>{`
.glass-container {
position: relative;
padding: 2rem;
border-radius: 1rem;
background: linear-gradient(135deg, #667eea, #764ba2, #f093fb);
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
}
.glass-bg-orb {
position: absolute;
border-radius: 50%;
filter: blur(40px);
opacity: 0.6;
}
.glass-bg-orb-1 {
top: 1rem;
left: 1rem;
width: 5rem;
height: 5rem;
background: #fbbf24;
}
.glass-bg-orb-2 {
bottom: 1rem;
right: 1rem;
width: 6rem;
height: 6rem;
background: #22d3ee;
}
.glass-button {
position: relative;
padding: 1rem 2rem;
border-radius: 0.75rem;
background: rgba(255, 255, 255, 0.2);
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
border: 1px solid rgba(255, 255, 255, 0.3);
color: white;
font-weight: 600;
cursor: pointer;
transition: all 0.3s ease;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}
.glass-button:hover {
background: rgba(255, 255, 255, 0.3);
transform: scale(1.05);
box-shadow: 0 8px 32px rgba(168, 85, 247, 0.2);
}
`}</style>
<div className="glass-container">
<div className="glass-bg-orb glass-bg-orb-1"></div>
<div className="glass-bg-orb glass-bg-orb-2"></div>
<button className="glass-button">
Glass Button
</button>
</div>
</>
);
}Vue
<template>
<div class="glass-container">
<div class="glass-bg-orb glass-bg-orb-1"></div>
<div class="glass-bg-orb glass-bg-orb-2"></div>
<button class="glass-button">Glass Button</button>
</div>
</template>
<script setup>
// Vue 3 Composition API
</script>
<style scoped>
.glass-container {
position: relative;
padding: 2rem;
border-radius: 1rem;
background: linear-gradient(135deg, #667eea, #764ba2, #f093fb);
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
}
.glass-bg-orb {
position: absolute;
border-radius: 50%;
filter: blur(40px);
opacity: 0.6;
}
.glass-bg-orb-1 {
top: 1rem;
left: 1rem;
width: 5rem;
height: 5rem;
background: #fbbf24;
}
.glass-bg-orb-2 {
bottom: 1rem;
right: 1rem;
width: 6rem;
height: 6rem;
background: #22d3ee;
}
.glass-button {
position: relative;
padding: 1rem 2rem;
border-radius: 0.75rem;
background: rgba(255, 255, 255, 0.2);
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
border: 1px solid rgba(255, 255, 255, 0.3);
color: white;
font-weight: 600;
cursor: pointer;
transition: all 0.3s ease;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}
.glass-button:hover {
background: rgba(255, 255, 255, 0.3);
transform: scale(1.05);
box-shadow: 0 8px 32px rgba(168, 85, 247, 0.2);
}
</style>LWC — HTML template
<template>
<div class="glass-container">
<div class="glass-bg-orb glass-bg-orb-1"></div>
<div class="glass-bg-orb glass-bg-orb-2"></div>
<button class="glass-button" onclick={handleClick}>
<slot>Glass Button</slot>
</button>
</div>
</template>LWC — JavaScript
import { LightningElement, api } from 'lwc';
export default class GlassButton extends LightningElement {
@api label = 'Glass Button';
handleClick(event) {
this.dispatchEvent(new CustomEvent('buttonclick', {
bubbles: true,
composed: true
}));
}
}LWC — CSS
.glass-container {
position: relative;
padding: 2rem;
border-radius: 1rem;
background: linear-gradient(135deg, #667eea, #764ba2, #f093fb);
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
}
.glass-bg-orb {
position: absolute;
border-radius: 50%;
filter: blur(40px);
opacity: 0.6;
}
.glass-bg-orb-1 {
top: 1rem;
left: 1rem;
width: 5rem;
height: 5rem;
background: #fbbf24;
}
.glass-bg-orb-2 {
bottom: 1rem;
right: 1rem;
width: 6rem;
height: 6rem;
background: #22d3ee;
}
.glass-button {
position: relative;
padding: 1rem 2rem;
border-radius: 0.75rem;
background: rgba(255, 255, 255, 0.2);
backdrop-filter: blur(20px);
-webkit-backdrop-filter: blur(20px);
border: 1px solid rgba(255, 255, 255, 0.3);
color: white;
font-weight: 600;
cursor: pointer;
transition: all 0.3s ease;
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}
.glass-button:hover {
background: rgba(255, 255, 255, 0.3);
transform: scale(1.05);
box-shadow: 0 8px 32px rgba(168, 85, 247, 0.2);
}
.glass-button:focus {
outline: 2px solid rgba(168, 85, 247, 0.5);
outline-offset: 2px;
}LWC — Configuration
<?xml version="1.0" encoding="UTF-8"?>
<LightningComponentBundle xmlns="http://soap.sforce.com/2006/04/metadata">
<apiVersion>59.0</apiVersion>
<isExposed>true</isExposed>
<targets>
<target>lightning__AppPage</target>
<target>lightning__RecordPage</target>
<target>lightning__HomePage</target>
</targets>
</LightningComponentBundle>Where Glass Button fits
- Modern UI
- Dashboard
- Overlay Actions
- Premium Apps
Interaction states & animations
- Hover
- Focus
- Pressed
Topics
- #glass
- #blur
- #transparent
- #modern
- #premium
- #backdrop-filter
Accessibility notes
Ensure sufficient contrast ratio (4.5:1 minimum) for text. Use aria-label for icon-only variants.
Browser support
- Chrome 76+
- Firefox 103+
- Safari 9+
- Edge 79+