Liquid GlassAPI Reference
Liquid GlassAPI Reference
createLiquidButton
Animated glass button with spring-driven interactions.
createLiquidButton
Creates a glass-styled button with built-in hover and click animations driven by spring physics.
Basic Usage
import { createLiquidButton } from '@avenra/liquid-glass';
const btn = createLiquidButton('#my-btn', {
label: 'Save Changes'
});
btn.on('click', () => console.log('Saved!'));Props / Options
Extends LiquidGlassOptions plus:
| Prop | Type | Default | Description |
|---|---|---|---|
label | string | undefined | Button text content |
Return Value — LiquidButtonHandle
| Member | Type | Description |
|---|---|---|
element | Element | The button element |
setLabel(text) | (string) => this | Update button label text |
destroy() | () => void | Clean up the component |
on('click', cb) | MouseEvent | Fired on click |
on('mouseenter', cb) | MouseEvent | Fired on hover start |
on('mouseleave', cb) | MouseEvent | Fired on hover end |
on('mousedown', cb) | MouseEvent | Fired on press |
on('mouseup', cb) | MouseEvent | Fired on release |
on('destroy', cb) | undefined | Fired on destruction |