0.0.10 • Published 6 months ago

@scriptedpixels/liquid-glass-vue v0.0.10

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

Liquid Glass Vue

Apple's Liquid Glass effect for Vue.

Card ExampleButton Example
npm.ionpm.io

Demo

Features

  • Proper edgy bending and refraction
  • Configurable frosty level
  • Supports arbitrary child elements
  • Configurable paddings
  • Correct hover and click effects
  • Edges and highlights take on the underlying light like Apple's does
  • Configurable chromatic aberration
  • Configurable elasticity, to mimic Apple's "liquid" feel

⚠️ NOTE: Safari only partially supports the effect (no displacement) and Firefox does not support it at all.

Usage

Installation

npm install @scriptedpixels/liquid-glass-vue

Basic Usage

import LiquidGlass from '@scriptedpixels/liquid-glass-vue'

Button Example

Mouse Container Example

When you want the glass effect to respond to mouse movement over a larger area (like a parent container), use the mouseContainer prop:

Props

PropTypeDefaultDescription
childrenVue.VueNode-The content to render inside the glass container
displacementScalenumber70Controls the intensity of the displacement effect
blurAmountnumber0.0625Controls the blur/frosting level
saturationnumber140Controls color saturation of the glass effect
aberrationIntensitynumber2Controls chromatic aberration intensity
elasticitynumber0.15Controls the "liquid" elastic feel (0 = rigid, higher = more elastic)
cornerRadiusnumber999Border radius in pixels
classstring""Additional CSS classes
paddingstring-CSS padding value
styleVue.CSSProperties-Additional inline styles
overLightbooleanfalseWhether the glass is over a light background
onClick() => void-Click handler
mouseContainerVue.RefObject<HTMLElement \| null> \| nullnullContainer element to track mouse movement on (defaults to the glass component itself)
0.0.10

6 months ago

0.0.9

6 months ago

0.0.8

6 months ago

0.0.7

6 months ago

0.0.6

6 months ago

0.0.5

6 months ago

0.0.4

6 months ago

0.0.3

6 months ago

0.0.2

6 months ago

0.0.1

6 months ago