Search
Search for a page

Glass View

The core styling primitive of Grgurevic UI. A premium physics-based refractive container with curvature profiles, light fringing, and specular glare.

bunx shadcn-svelte@latest add https://ui.grgurevic.click/r/glass-view.json

Usage

A basic refractive container enclosing custom content.

Variants

The backdrop styling variant configuration options.

Liquid glass disabled in preview for performance reasons

Best practices

The best practices when styling glass elements.

  • Use the Glass View component sparingly to prevent performance issues and rendering overhead on lower-end devices.
  • Keep refractive index settings within a realistic range of 1.2 to 1.8 for standard glass simulations.
  • Pair Glass View with high-contrast backgrounds to showcase the edge refraction.
  • Disable chromatic aberration on low-end devices to conserve rendering performance. The logoSwitch component also supports a liquidGlass prop for consistent glass styling.
  • Ensure the saturation boost is kept subtle to avoid unrealistic color distortions. Components like logoButton expose the same glass tuning parameters.

Props

The props available for the Glass View component.

PropTypeDefaultDescription
variant"prominent" | "bordered" | "secondary" | "translucent" | "ghost" | "destructive""prominent"Backdrop filter/opacity configuration.
size"xs" | "sm" | "default" | "lg""default"Paddings configuration.
magneticbooleantruePulls the card toward the pointer using spring drag parameters.
scalebooleantrueSqueezes on holding and click actions.
specularbooleantrueProjects precise 3D specular light glare onto borders.
liquidGlassbooleanfalseEnables the Apple-inspired physical glass refraction and specular overlay.
refractiveIndexnumber1.5The index of refraction (IOR). Simulates realistic physical bending of background light.
bezelWidthnumber20The width of the refraction zone around the element's border (in pixels).
displacementScalenumber40SVG displacement mapping strength. Controls the magnitude of pixel shift.
surfaceProfile"circle" | "squircle" | "concave" | "lip""squircle"The height curve shape of the bezel. "squircle" matches Apple's design curvature perfectly.
chromaticAberrationbooleanfalseEnables 3-channel (RGB) parallel displacement to produce hyper-realistic rainbow fringing.
saturationBoostnumber1.3Amplifies color saturation inside the glass container to simulate prism color amplification.
backgroundBlurnumber0.3Slight pre-blur parameter to prevent hard pixels and alias edges inside the refraction.
Previous Dropdown Menu
Give feedback
Next Input