Pro
Avatar upload
Change a profile photo in place. Click the avatar or drop an image on it and the photo opens inside the circle to position and zoom; saving crops it, uploads it through a ring that fills around the avatar, and settles with a tick.
pnpm dlx shadcn@latest add @caliper/avatar-uploadWhen to use
Use it for
- Profile, account and team member settings.
- Workspace and organisation logos (any square image).
Skip it when
- Galleries or several files at once; use `FileDropzone`.
- Free-form crops; use `ImageCrop`.
Decisions
Why it is built this way, so you know what to keep when you change your copy.
Behaviour
- Crop where it will live
- Positioning happens inside the avatar's own circle, so what you see is what everyone will see.
- Progress on the edge
- The upload ring wraps the avatar instead of replacing it, and turns green with a tick when done.
Usage
- Clear failures
- Wrong file types and large files are refused with a reason, and a failed upload offers Try again with the same crop.
Installation
pnpm dlx shadcn@latest add @caliper/avatar-upload
Adds its 4 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.
Usage
Import it from your copy of the source. The example behind the preview comes with the source.
import { AvatarUpload } from "@/components/ui/avatar-upload"
The worked example comes with Pro
The 38-line example behind the preview opens here, ready to copy.
- 602 Pro parts, blocks and page templates, all with source
- $199 once, with a year of updates. What you have stays yours
- A full refund within 14 days if it is not for you
API reference
AvatarUpload
component
Also accepts the native props of its root element and a ref.
Accessibility
It exposes img semantics, with aria-label, aria-hidden and aria-live kept in step with state. Changes that matter are announced through a live region.
Motion
It declares no animation in its component source. Any transition comes from its stylesheet, which uses the duration tokens that collapse to instant under prefers-reduced-motion.
Related
- AvatarA person's photo, falling back to initials when there is no image.
- Image cropCrop an image before it is uploaded. Drag the frame to move it and a handle to resize it; a rule-of-thirds grid shows while you work. A fixed shape keeps only the corner handles, and every move works from the keyboard.
- File dropzoneDrop or choose files, with per-file progress, errors and cancel.