# Avatar Upload

> A profile photo picker where a picked, dropped or pasted image shows at once, blurred, and sharpens as a ring around the avatar fills with the upload's progress.

## Spec sheet

| | |
| --- | --- |
| Access | Free: no account, free for commercial use |
| Shelf | Components › Avatars & Badges |
| Live preview | https://uibrik.com/components/avatar-upload |
| Writes | 1 file into `components/uibrik/avatar-upload/` |
| Packages | `@tabler/icons-react`, `motion` (the CLI installs them) |
| Needs | React 19, Tailwind CSS v4, a project set up with `npx shadcn@latest init` |
| Theme | Reads the shadcn tokens and follows class-based dark mode ([theming](https://uibrik.com/docs/theming.md)) |
| Updated | Nov 30, 2026 |

## Add it

```bash
npx shadcn@latest add https://uibrik.com/r/avatar-upload.json
```

With the `@uibrik` namespace in `components.json` ([setup](https://uibrik.com/docs/installation.md)): `npx shadcn@latest add @uibrik/avatar-upload`.

Can't run commands? https://uibrik.com/components/avatar-upload/prompt.txt has every file verbatim, with the setup steps, ready for an assistant to write.

## Render it

Renders as is; every value shown is the default, so delete any line you don't need.

```tsx
import { AvatarUpload } from "@/components/uibrik/avatar-upload/avatar-upload";

const accept = "image/png,image/jpeg,image/webp,image/gif,image/avif";

<AvatarUpload
  size={104}
  shape="circle"
  blur={10}
  maxSizeMb={5}
  removable
  showStatus
  defaultValue={null}
  name="Ada Park"
  accept={accept}
  disabled={false}
  onUpload={(file, { onProgress, signal }) => {}}
  // value="…"
  // onChange={(src, file) => {}}
/>
```

## Tune it

The same props as the Customize panel on https://uibrik.com/components/avatar-upload.

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| `size` | `number` | `104` | Avatar diameter. |
| `shape` | `"circle" \| "rounded"` | `"circle"` | Circle for people, rounded square for logos. |
| `blur` | `number` | `10` | Blur on the photo at 0%. It clears as the upload runs. |
| `maxSizeMb` | `number` | `5` | Largest file accepted. |
| `removable` | `boolean` | `true` | Show a Remove action under a set photo. |
| `showStatus` | `boolean` | `true` | Hints, progress and errors under the avatar. |

## Wire it

The props the Customize panel doesn't show: ranges, data, content and callbacks.

| Prop | Type | Default | What it does |
| --- | --- | --- | --- |
| `value / onChange` | `string \| null / (src, file?) => void` |  | Controlled image URL. onChange gets the stored URL (or the local preview URL with no onUpload) and the picked file, or null on remove. |
| `defaultValue` | `string \| null` |  | Image URL on mount when uncontrolled. |
| `onUpload` | `(file, { onProgress, signal }) => Promise<string \| void>` |  | Uploads the file. Call onProgress with 0 to 1, resolve with the stored image's URL, throw to fail. The signal aborts when the person cancels. Leave out to accept files locally. |
| `name` | `string` |  | Initials shown with no photo, and the accessible name. |
| `accept` | `string` | `"image/png,image/jpeg,image/webp,image/gif,image/avif"` | Which files the picker offers. |
| `disabled` | `boolean` | `false` | Ignore presses and drops. |
| `className` | `string` |  | Classes for the wrapper. |

## Where it fits

- **Profile settings**: The new photo appears the moment it's picked, so the person sees the result while it saves. Pairs with [Settings Page](https://uibrik.com/components/settings-page.md) (Pro).
- **Onboarding**: One tap, drag and drop or paste covers every way people add a photo. Pairs with [Multi-step Form](https://uibrik.com/components/multi-step-form.md) (Pro).
- **Team and workspace logos**: The rounded shape fits logos, and failed uploads keep the image with a Retry. Pairs with [Team Roster](https://uibrik.com/components/team-roster.md) (Pro).

## Same shelf: Avatars & Badges

- [Contribution Avatar](https://uibrik.com/components/contribution-avatar.md) (Pro): An avatar wrapped in its own contribution graph: rings of days and spokes of weeks that light up in a sweep. Hover a day for its count and week, tap to pin it, and pick out a shade or the streak from the key.
- [Light Badge](https://uibrik.com/components/light-badge.md): A badge lit from below by a rotating gradient stroke and soft rays.
- [Social Avatar](https://uibrik.com/components/social-avatar.md): An avatar that fans the person's social accounts out of itself along an arc, with real brand logos that copy the handle or open the profile on press.
- [Status Badge](https://uibrik.com/components/status-badge.md): One status pill that moves between states: the tint eases to the new colour, the icon turns in, the label rolls and the pill glides to its new width.
- [Story Ring](https://uibrik.com/components/story-ring.md): An avatar in a segmented story ring that spins into dashes while a story loads, then drains the arc you opened to grey.
- [Tech Stack](https://uibrik.com/components/tech-stack.md): A row of real brand logos for the tools behind a product that open into tinted pills naming each one as neighbours slide aside.

## Ground rules

- Only the props above exist. To change anything else, edit the installed file.
- Keep the files in `components/uibrik/avatar-upload/` so the import paths keep resolving.
- The playbook for working with the whole library: https://uibrik.com/llms.txt
