Glass Orb

Pro

Draggable droplet of glass that follows your finger, squashes and stretches with speed and catches light on its rim. Let go and it springs home, or fling it to dock in the nearest corner.

Preview

Installation

npx
npx @lumioui/cli add pro/glass-orb

Usage

import { GlassOrb } from "@/components/ui/glass-orb/glass-orb";
<GlassOrb />

API reference

Prop Type Default
y* number }) => void —
height* number } —
size number

Diameter in pt. Default 80.

80
snapBack boolean

Spring back to origin on release (default true). False = stays dropped.

true
bend number

Refraction strength 0–1 passed to Glass bend.

0.6
onDrop (offset?: { x: number

Called on release with the orb's offset from its origin.

—
dockBounds { width: number

Size of the parent the orb floats in. With snapBack={false}, a release projects the fling and docks to the nearest corner.

—
dockInset number | { top?: number

Gap kept from the parent's edges when docked: one number, or per edge so the corners clear other chrome (a call pill along the top). Default 16.

16
right number —
bottom number —
left number } —
level SharedValue<number>

A live 0–1 level (e.g. the other caller's voice): the rim brightens and the glass band lifts with it, read on the UI thread. Stop writing it while off-screen.

—
igniteKey number

Change this to flash the rim as if the orb had just landed — e.g. as a screen that grew out of it collapses back in.

—
onPress (frame: GlassOrbFrame) => void

A tap (not a drag) — receives the orb's frame so a screen can grow out of it.

—
className string —
children React.ReactNode —