Sha256: 257e6c8f601ca12ee79b3f081a48f24f4b7e030ec9646801d7108e5406a0dbd3
Contents?: true
Size: 1.2 KB
Versions: 15
Compression:
Stored size: 1.2 KB
Contents
import React from 'react' import classnames from 'classnames' import { GlobalProps, globalProps } from '../utilities/globalProps' import { buildAriaProps, buildCss, buildDataProps } from '../utilities/props' type ImageType = { alt?: string, aria?: {[key: string]: string}, className?: string, data?: {[key: string]: string}, id?: string, onError?: () => void, size?: "xs" | "sm" | "md" | "lg" | "xl", rounded?: boolean, transition?: "blur" | "fade" | "scale", url?: string, } & GlobalProps const Image = (props: ImageType) => { const { alt = '', aria = {}, className, data = {}, id, onError = null, rounded = false, size = '', transition = 'fade', url = '', } = props const ariaProps = buildAriaProps(aria) const classes = classnames( buildCss('pb_image_kit', size ? `size_${size}` : null), 'lazyload', transition, { rounded }, globalProps(props), className ) const dataProps = buildDataProps(data) return ( <img {...ariaProps} {...dataProps} alt={alt} className={classes} data-src={url} id={id} onError={onError} src={url} /> ) } export default Image
Version data entries
15 entries across 15 versions & 1 rubygems