react-eye
TypeScript icon, indicating that this package has built-in type declarations

1.0.5-alpha.1-3 • Public • Published

react-eye

About

Eye Component follows mouse.

Usage

npm:

npm i react-eye

yarn:

yarn add react-eye

Getting started with react-eye

Here is an example of a basic app with Eye component:

import * as React from "react";
import Eye from "react-eye";

function App() {
return (
    <>
      <Eye
        white={{
          x: 150,
          y: 150,
        }}
        iris={{
          x: 100,
          y: 100,
          color: "chocolate",
        }}
      />
    </>
  )
}

props

name type description
white { x: number; y: number; } configuration for white part of eye, x is for vertical, y is for horizontal size
iris { x: number; y: number; color?: string; } configuration for iris. x is for vertical, y is for horizontal size, color for iris fill
controlerRef React.MutableRefObject<{ watch: (targetPosition: { x: number; y: number }) => void; }> ref reception for controler, for now only "watch" will back.that make focus for target position specified
throttleInterval number specify throttle interval for mouse trace

also "style" and "className" are available for styling!

Contributing

Thanks so much for your interest! Any suggestion and pull requests are welcome!!

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i react-eye

Weekly Downloads

1

Version

1.0.5-alpha.1-3

License

MIT

Unpacked Size

398 kB

Total Files

11

Last publish

Collaborators

  • tictaca