Skip to content

AvatarUpload

A person's picture, in a circle: their initials until there is one.

import { AvatarUpload } from '@sypnia/ui/react'

On this page
  1. A profile photo
  2. When to use it
  3. For everyone
  4. Props

A profile photo

AR
Code
import { useState } from 'react';
import { AvatarUpload } from '@sypnia/ui/react';

// The initials until there is a photo.
export default function Photo() {
  const [file, setFile] = useState<File | null>(null);
  return <AvatarUpload name="Ana Ruiz" file={file} onChange={setFile} />;
}

When to use it

Use it when

  • Profiles and members.

Do not use it when

  • Logos: use ImageUpload, which keeps the shape.

For everyone

  • The avatar is named with the person's name.

Props

AvatarUploadTypeDefault
namerequired string
onChangerequired (f: File | null) => void
file File | null
loading

The person's picture is on its way: the circle and the buttons are skeletons of their own boxes (pass the last known `value`, so the buttons are the ones that will come).

boolean
maxSize number 1024 * 1024
value string | null
  1. A profile photo
  2. When to use it
  3. For everyone
  4. Props

    Search pages, sections and terms