Glassmorphic Button Template

Create a beautiful "frosted glass" effect with this modern glassmorphic button.

This design style is perfect for interfaces that sit on top of colorful backgrounds, adding depth and a sense of layered perspective to your page.

Screenshot of a frosted-glass or glassmorphic button.

Get Source Code Preview

About the Glassmorphic Button

Glassmorphism is a design trend characterized by transparency, background blur, and a subtle border that makes an element look like it's made of frosted glass. This effect is useful for creating a visual hierarchy, making foreground elements distinct from the background while still allowing the background to show through. For the effect to be noticeable, it needs to be placed on a colorful or detailed background, such as a gradient or a photo.

Features

Code Breakdown

The glassmorphic effect is achieved with two CSS properties. First, background-color is set to a color with an alpha channel (e.g., rgba(255, 255, 255, 0.2)) to make the button partially transparent. Second, the backdrop-filter property is set to blur(), which applies a blur to everything visible behind the button. The container in this template uses a CSS gradient, but this can easily be swapped for a background-image to achieve the effect over a photograph.

Code

Here is the complete code for the glassmorphic button.

View Output