ResponsivePicture React component for Forte.EpiResponsivePicture package
npm install --save epiresponsivepicture-react
import React, { Component } from 'react'
import ResponsivePicture from 'epiresponsivepicture-react'
import 'epiresponsivepicture-react/dist/index.css'
model: ResponsiveImageViewModel;
profile: PictureProfile;
imgAttributes?: any
class Example extends Component {
render() {
return <ResponsivePicture model={imageModel} profile={pictureProfile} />
}
}
ResponsivePicture component accepts numerous parameters:
-
model
(required), having following properties:-
url
- base URL of the image, -
focalPoint
- focal point of the image, withx
andy
properties. Each property should be number in range of 0..1 -
width
andheight
of the original image, -
alt
for the<img>
tag,
-
-
profile
(required), being serialized picture profile (camel cased) -
imgAttributes
- set of additional HTML attributes that should be present in<img>
tag.
MIT © Forte Digital