Props
ImageDisplayerProps
Name | Type | Default Value | Description |
---|---|---|---|
url | string | - | URL of the image. This is the only required prop of these component. |
token | string | undefined | JWT token. Use only if the image needs JWT authentication. |
headers | Record <string, string> | undefined | Custom headers for HTTP GET request that downloads image. |
delay | number | 0 | Amount of time (in ms) to wait before mounting the image, just after downloading it. |
enterAnimation | [EnterAnimation, AnimationDuration] | undefined | Enter animation of image. First element of the tuple is the animation name, second element is duration (in seconds) of the animation. Set ['none',0] for no animation. |
framerMotionProps | FramerMotionProps | undefined | Custom Framer Motion library props for enter animation of image. |
imageStyle | CSSProperties | undefined | Custom 'Style' Prop for image. |
spinner | SpinnerProps | undefined | Props of spinner. |
onDownload | () => void | () => undefined | Function that executed just after image is downloaded. In other words just before image is displayed/mounted. |
onLoad | () => void | () => undefined | Function that executed just after image is displayed/mounted. |
onError | () => void | () => undefined | Function that executed on any error occurred during downloading or mounting image. |
consoleError | boolean | false | Errors are console logged if that is set true. |
ItemDisplayerProps
Name | Type | Default Value | Description |
---|---|---|---|
loaded | boolean | true | Shows & hides the item using '&&' operator. |
loadedInStyle | boolean | true | Shows & hides the item using style (display: 'initial' or display: 'none'). |
enterAnimation | [EnterAnimation, AnimationDuration] | undefined | Enter animation of image. First element of the tuple is the animation name, second element is duration (in seconds) of the animation. Set ['none',0] for no animation. |
framerMotionProps | FramerMotionProps | undefined | Custom Framer Motion library props for enter animation of image. |
spinner | SpinnerProps | undefined | Props of spinner. |
children | ReactNode | undefined | Item that is displayed. |
SpinnerProps
Name | Type | Default Value | Description |
---|---|---|---|
spinnerType | SpinnerType | 'ClipLoader' | The exact spinner component name from React Spinners library. Set 'none' for no spinner. |
spinnerCss | CSSProperties | {} | Custom 'Style' Prop for the spinner. |
color | string | 'blue' | Color of the spinner. |
size | string | '2rem' | Size of the spinner. |
aspectRatio | string | '16/9' | Aspect ratio of the spinner wrapper. If you set the aspect ratio of the image, the height of the wrapper will be the same as the image. |
wrapperHeight | string | '' | Height of the spinner wrapper. |