Glass JS behaviour

Glass button

A pressable glass pane with springy press feedback; shimmer sends the light once around the rim when pressed.

Real scenarios

The component as it is used in a product — not a specimen grid.

A transport bar over the video

All demos

Press “Resume” and watch the light go around the rim once.

Sizes, sm to lg

static — no press squeeze

For places where the squeeze would distract from the content behind.

Important props

Important props
Prop Type Default What it does
icon / icon-end string null An icon leading or trailing the label; with no text the button is icon-only (give it an aria-label).
size / preset string md · regular Size (sm · md · lg) and the glass body (regular · clear · frost · thick).
shimmer bool false Every press sends the light around the rim once.
iridescent / static bool false iridescent: rainbow rim; static: no press scale.
href string null With href the button becomes a link.

Snippet

<x-nx::glass-button icon="play" shimmer wire:click="play">پخش</x-nx::glass-button>
<x-nx::glass-button icon="heart" iridescent>ذخیره</x-nx::glass-button>
<x-nx::glass-button icon="settings" preset="thick" aria-label="تنظیمات" />