0.1.16 • Published 3 years ago

react-focus-point-image v0.1.16

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

react-focus-point-image

Focus is set on one object in an image. When the aspect ratio of the image container changes responsively, the focused part of the image will always be visible.

Demo

See working Demo here

Install

yarn

yarn add react-focus-point-image

npm

npm i react-focus-point-image

Example usage

import ReactFocusPointImage from 'react-focus-point-image';

<Wrapper style={{ width, height }}>
  <ReactFocusPointImage
    src="parrot.jpg"
    alt="A parrot"
    focusPoint={[61, 20]}
    animate
  />
</Wrapper>

Options

PropertyDescription
src{string} src of the image
alt?{string} alt text
focusPoint{number[]} x, y 0-100
animate?{boolean} when true image will fade in
minWidth?{number}
minHeight?{number}
maxWidth?{number}
maxHeight?{number}
0.1.16

3 years ago

0.1.15

3 years ago

0.1.14

3 years ago

0.1.13

3 years ago

0.1.12

3 years ago

0.1.11

3 years ago

0.1.10

3 years ago

0.1.9

3 years ago

0.1.8

3 years ago

0.1.7

3 years ago

0.1.6

3 years ago

0.1.5

3 years ago

0.1.4

3 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago