Skip to content

ImageUpload

An image with its preview: a logo, a cover. Choose, replace or remove; a file that is too large or not an image is refused with a message that says what to do.

import { ImageUpload, ImageUploadSkeleton } from '@sypnia/ui/react'

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

When to use it

Use it when

  • Logos, covers, product images.

Do not use it when

  • People's photos: use AvatarUpload.

For everyone

  • The preview has the image's name as its text; errors are read when they appear.

Props

ImageUploadTypeDefault
labelrequired string
onChangerequired

Receives the new file, or null when the person removes the image.

(f: File | null) => void
file

The chosen file, before it is saved.

File | null
maxSize number 2 * 1024 * 1024
ratio "square" | "wide" wide
value

The current image on the server.

string | null
ImageUploadSkeletonTypeDefault
ratio "square" | "wide" wide
  1. A project logo
  2. When to use it
  3. For everyone
  4. Props

    Search pages, sections and terms