Skip to content

Simple react custom cursor based on plain javascript package Kursor 🔥

Notifications You must be signed in to change notification settings

kostberg/react-kursor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Simple react custom cursor based on plain javascript package Kursor 🔥

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published