A wrapper around the native file input that enforces extensions and file size, as well as specific dimensions. Returns a file object by default - or the base64 encoded string if specified otherwise.
Props
Name
Required
Nullable
Type
children
React.Element<any>
dims
{ minWidth: number, maxWidth: number, minHeight: number, maxHeight: number }
onChange
(Array<File> | string) ⇒ void | Promise<void>
onError
(string) ⇒ void | Promise<void>
base64
boolean
extensions
Array<string>
maxSize
number
style
CSSStyleDeclaration
Examples
Multiple Files
Select Files
() => ( <ImagePicker onChange={console.log} onError={console.log}> <PrimaryButton>Select Files</PrimaryButton> </ImagePicker> )