0.0.2 • Published 3 years ago
epiresponsivepicture-react v0.0.2
epiresponsivepicture-react
ResponsivePicture React component for Forte.EpiResponsivePicture package
Install
npm install --save epiresponsivepicture-react
Usage
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} />
}
}
Parameters
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..1width
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.
License
MIT © Forte Digital