# AvatarDropzone

> Cherry AvatarDropzone component - a circular single-file dropzone for profile pictures in three sizes.

Source: https://cherry.al/code/avatar-dropzone

> For the complete documentation index, see [llms.txt](https://cherry.al/llms.txt).

# AvatarDropzone

<iframe className="light-only" src="https://demo.cherry.al/preview/avatar-dropzone?theme=light" title="Avatar dropzone" loading="lazy" style={{ width: "100%", height: "320px", border: "1px solid var(--color-grayLight)", borderRadius: "12px" }} />
<iframe className="dark-only" src="https://demo.cherry.al/preview/avatar-dropzone?theme=dark" title="Avatar dropzone" loading="lazy" style={{ width: "100%", height: "320px", border: "1px solid var(--color-grayLight)", borderRadius: "12px" }} />

The AvatarDropzone component is a circular, single-file dropzone for profile pictures. While empty it shows a dashed circle with an icon; a selected image fills the circle and can be removed with the corner button. Selecting a new file replaces the current one.

For design guidelines and all interactive states, see the [Inputs](/inputs) design page.

```jsx
import React from "react";
import { AvatarDropzone } from "cherry-styled-components";

export default function Page() {
  return (
    <AvatarDropzone
      $maxBytes={5 * 1024 * 1024}
      onFileChange={(file) => console.log(file)}
      onFileRejected={({ file, reason }) => console.warn(file.name, reason)}
    />
  );
}
```

With sizes:

```html
<AvatarDropzone $size="small" />
<AvatarDropzone $size="big" />
```

## Properties

<Field value="$size" type='"default" | "big" | "small"'>
  Size of the circle: 64px (small), 96px (default), or 128px (big).
</Field>

<Field value="$icon" type="IconProps">
  Name of the Lucide icon shown while empty. `IconProps` is a string union of all Lucide icon names, not an object. Defaults to `"User"`.
</Field>

<Field value="$maxBytes" type="number">
  Maximum file size in bytes.
</Field>

<Field value="aria-label" type="string">
  Accessible label for the drop target. Defaults to `"Upload profile
  picture"`.
</Field>

<Field value="onFileChange" type="(file: File | null) => void">
  Called with the selected picture, or `null` when it is removed.
</Field>

<Field value="onFileRejected" type="(rejection: DropzoneRejection) => void">
  Called when a file is rejected for being the wrong type or too big.
</Field>

<Field value="accept" type="string">
  Native accept filter. Defaults to `"image/*"`.
</Field>

<Field value="disabled" type="boolean">
  Disables the dropzone: the tile is dimmed and clicks and drops are ignored.
</Field>

AvatarDropzone forwards its ref to the hidden file input, and any remaining native `<input>` attributes (`name`, `id`, `onBlur`, and so on) pass through to it. The props above are typed by the exported `AvatarDropzoneProps` interface.

<Button href="https://github.com/cherry-design-system/styled-components/blob/main/src/lib/avatar-dropzone.tsx" icon="code" iconPosition="left">
  View Source
</Button>
