Skip to content

Latest commit

 

History

History
56 lines (42 loc) · 1.2 KB

README.md

File metadata and controls

56 lines (42 loc) · 1.2 KB

React Kursor 🔥🔥

Simple react custom cursor based on plain javascript package Kursor

NPM JavaScript Style Guide

Install

npm install --save react-kursor

Usage

import React from 'react'
import Kursor from 'react-kursor'

function App(){
    return (
        <Kursor color="#ffffff">
            // Content goes here...
        </Kursor>
    )
}

Implement hover functionality on kursor wrapped component

import React from 'react'
import { useKursor } from 'react-kursor'

function Button(){
    const { hoverIn, hoverOut } = useKursor();
    return (
        <div className="button" onMouseEnter={ hoverIn } onMouseLeave={ hoverOut }>
            Button 
        </div>
    )
}

Options

  • removeDefaultCursor = true <boolean>
  • color = "#000000" <string (either hexcode or rgb)>

Options coming soon

  • kursorId: key = "" <any>
  • local = false <boolean>
  • shouldRender = true <boolean>
  • type = 1 <int>

License

MIT © kostberg