Skip to main content

Props

ImageDisplayerProps

NameTypeDefault ValueDescription
urlstring-URL of the image. This is the only required prop of these component.
tokenstringundefinedJWT token. Use only if the image needs JWT authentication.
headersRecord <string, string>undefinedCustom headers for HTTP GET request that downloads image.
delaynumber0Amount of time (in ms) to wait before mounting the image, just after downloading it.
enterAnimation[EnterAnimation, AnimationDuration]undefinedEnter 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.
framerMotionPropsFramerMotionPropsundefinedCustom Framer Motion library props for enter animation of image.
imageStyleCSSPropertiesundefinedCustom 'Style' Prop for image.
spinnerSpinnerPropsundefinedProps of spinner.
onDownload() => void() => undefinedFunction that executed just after image is downloaded. In other words just before image is displayed/mounted.
onLoad() => void() => undefinedFunction that executed just after image is displayed/mounted.
onError() => void() => undefinedFunction that executed on any error occurred during downloading or mounting image.
consoleErrorbooleanfalseErrors are console logged if that is set true.

ItemDisplayerProps

NameTypeDefault ValueDescription
loadedbooleantrueShows & hides the item using '&&' operator.
loadedInStylebooleantrueShows & hides the item using style (display: 'initial' or display: 'none').
enterAnimation[EnterAnimation, AnimationDuration]undefinedEnter 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.
framerMotionPropsFramerMotionPropsundefinedCustom Framer Motion library props for enter animation of image.
spinnerSpinnerPropsundefinedProps of spinner.
childrenReactNodeundefinedItem that is displayed.

SpinnerProps

NameTypeDefault ValueDescription
spinnerTypeSpinnerType'ClipLoader'The exact spinner component name from React Spinners library. Set 'none' for no spinner.
spinnerCssCSSProperties{}Custom 'Style' Prop for the spinner.
colorstring'blue'Color of the spinner.
sizestring'2rem'Size of the spinner.
aspectRatiostring'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.
wrapperHeightstring''Height of the spinner wrapper.