Skip to main content
Version: 1.0.0

ImagePicker

@spartanfx/react v1.0.0


@spartanfx/react / ImagePicker

Variable: ImagePicker

const ImagePicker: React.FunctionComponent<IImagePicker>

ImagePicker is a React component that enables selecting, previewing, and uploading images to a SharePoint list item using the UploadImage API.

Intended for use with image fields bound to the SharePoint list schema.

Example

<ImagePicker
sp={sp}
imageFieldValue={item.Image}
onFileSelected={async (file) => {
const newValue = await pushFile(sp, context, 'Documents', item.Id, file, 'Image');
await sp.web.lists.getByTitle('Documents').items.getById(item.Id).update({
Image: newValue
});
}}
/>