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.
Click or drop a photo
When to use
- Profile, account and team member settings.
- Workspace and organisation logos (any square image).
When not to use
- Galleries or several files at once; use `FileDropzone`.
- Free-form crops; use `ImageCrop`.
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.
API reference
AvatarUpload
4 props
Also accepts the native props of its root element and a ref.
Keyboard
- Enter
- Activates the focused control.
- Escape
- Closes or cancels, then returns focus to where it came from.
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.
Notes for AI
Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.
/docs/components/avatar-upload.mdThe index of every part is at /llms.txt.