Browse components
Draggable Avatar
An avatar you can drag and fling around its container; it springs to the nearest corner with the throw's momentum.
Installation
npx shadcn@latest add @glint-ui/draggable-avatarFirst time using @glint-ui? Add the registry to components.json once, or install by URL: npx shadcn@latest add https://glint-ui-seven.vercel.app/r/draggable-avatar.json
Usage
import { DraggableAvatar } from "@/components/ui/draggable-avatar";
<div className="relative h-96 overflow-hidden rounded-3xl">
<DraggableAvatar src="/me.jpg" alt="Your camera" corner="bottom-right" />
</div>Props
| Prop | Type | Default | Description |
|---|---|---|---|
| src | string | — | Image URL. |
| alt | string | "Avatar" | Accessible name. |
| size | number | 88 | Avatar size in px. |
| corner | "top-left" | "top-right" | "bottom-left" | "bottom-right" | "bottom-right" | Corner it starts in. |
| padding | number | 16 | Gap to the container edge in px. |
| shape | "circle" | "rounded" | "circle" | Circle or rounded square. |
| stiffness | number | 380 | Spring stiffness of the snap. |
| damping | number | 26 | Spring damping. Lower is bouncier. |
| status | boolean | true | Green presence dot. |
| className | string | — | Extra classes for the root element. |