Skip to content
Avatar dropzone, light
Light
Avatar dropzone, dark
Dark

Every state

  • Avatar dropzone, default, light
    Avatar dropzone, default, dark

    default

  • Avatar dropzone, focus, light
    Avatar dropzone, focus, dark

    focus

  • Avatar dropzone, dragging, light
    Avatar dropzone, dragging, dark

    dragging

  • Avatar dropzone, uploading, light
    Avatar dropzone, uploading, dark

    uploading

  • Avatar dropzone, done, light
    Avatar dropzone, done, dark

    done

  • Avatar dropzone, error, light
    Avatar dropzone, error, dark

    error

  • Avatar dropzone, disabled, light
    Avatar dropzone, disabled, dark

    disabled

Props

PropTypeDefaultWhat it does
idstring"avatar"Id prefix for the hint and error.
namestring"avatar"Form field name of the file input.
labelstring"Profile photo"The visible label beside the circle.
initialsstring"AK"Shown in the circle while there is no photo.
acceptstring"image/jpeg,image/png"Allowed image types; checked before upload.
maxSizenumber2097152The largest file in bytes.
hintstring"JPG or PNG, up to 2 MB"A short note on the allowed files.
defaultPreviewstring–The photo to start with, as a URL.
defaultStatus"idle" | "uploading"–Start in uploading to draw the ring without a real file.
defaultProgressnumber–0 to 100, used with defaultStatus uploading.
draggingboolean–Draws the circle as if a file is being dragged over it.
upload(file, { onProgress, signal }) => Promise<void>–Sends the file. The default is a local simulation that fails for names containing "fail".
errorstring–A message under the row; marks the circle invalid.
disabledboolean–Disables the circle and the buttons.
onFileChange(file: File | null) => void–Called with the uploaded file, or null when removed.
classNamestring–Extra classes on the wrapper.

More file uploads

All 12
file-upload-02 is in UI ProGet UI Pro, €199

Preview

Open the page
In UI Pro: get it, €199 once

With every block and theme. 400+ buyers since 2020. Plans