interface ImagePickerProps

Passed to ImagePicker by an edit page, which uploads the file and then passes the new image, or a local preview of it, as src.

Properties

src: string | null

Shows a "+" placeholder when null.

optional
alt: string
optional
size: number

Sets the side, in pixels. Without it, className sizes the picker.

optional
borderRadius: number | string

In pixels when a number, or any CSS length, such as a radius token.

onChange: (file: File) => void

Called with the file picked. The same file can be picked again.

optional
uploading: boolean

Disables the picker and shows "…" while the caller uploads.

optional
accept: string

Replaces the default types, which are JPEG, PNG, GIF and WebP.

optional
className: string

Usage

import { type ImagePickerProps } from "src/components/shared/ImagePicker.tsx";