Avatar

A picture, or initials while it loads, in a disc of glass.

HA
TC
JI

Installation#

pnpmnpmyarnbun
$ pnpm dlx shadcn@latest add @liquikit/avatar

Needs the @liquikit registry in your components.json. Set it up once.

Usage#

import { Avatar } from "@/components/liquikit/avatar"
<Avatar src="/maya.jpg" alt="Maya" fallback="MA" size={48} />

API Reference#

Avatar

PropTypeDefault
theme"light" | "dark"

Light or dark glass. Falls back to the nearest GlassThemeProvider, then light.

—
lensPartial<LensProfile>

Overrides for the lens profile, such as thickness, bevel, ior and magnification.

—
liquidnumber

How far the glass squashes and stretches as it moves. 0 keeps it rigid.

—
srcstring

URL of the picture.

—
altstring

Describes the picture.

""
fallbackReactNode

Shown while the picture loads, or if it fails. Usually initials.

—
sizenumber

Diameter, in pixels.

40
refraction"interactive" | "always"

When the glass bends the page. interactive bends it while the component is pressed, dragged or focused, always bends it all the time.

"interactive"