Back to Twenty

Image Input

packages/twenty-docs/twenty-ui/input/image-input.mdx

2.2.01.0 KB
Original Source
<Frame> </Frame>

Allows users to upload and remove an image.

<Tabs> <Tab title="Usage">
jsx
import { ImageInput } from "@/ui/input/components/ImageInput";

export const MyComponent = () => {
  return <ImageInput/>;
};
</Tab> <Tab title="Props">
PropsTypeDescription
picturestringThe image source URL
onUploadfunctionThe function called when a user uploads a new image. It receives the File object as a parameter
onRemovefunctionThe function called when the user clicks on the remove button
onAbortfunctionThe function called when a user clicks on the abort button during image upload
isUploadingbooleanIndicates whether an image is currently being uploaded
errorMessagestringAn optional error message to display below the image input
disabledbooleanIf true, the entire input is disabled, and the buttons are not clickable
</Tab> </Tabs>