🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

@feverus/react-custom-cursor

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@feverus/react-custom-cursor

## Установка ``` npm i @feverus/react-custom-cursor ```

0.1.7
latest
npm
Version published
Weekly downloads
8
-60%
Maintainers
1
Weekly downloads
 
Created
Source

Кастомные курсоры для React приложений

Установка

npm i @feverus/react-custom-cursor

Демо страница

https://react-custom-cursor-demo.vercel.app

Использование:

import { CustomCursor } from '@feverus/react-custom-cursor'
import '@feverus/react-custom-cursor/dist/style.css'

const muCursor = 'любой JSX элемент, строка или предустановленный курсор из списка ниже'

<CustomCursor cursor={muCursor}>
   <>ваш компонент</>
</CustomCursor>

Параметры:

НазваниеТипПо умолчаниюОписание
hoverClassNamestringstyle.css > .hoverСтиль курсора при наведении на <a> или <button>
scalenumber1Изменяет масштаб курсора
rotatingboolean | 'auto' | 'onMove'falseБез вращения
true - Поворачивает курсор вокруг центра области. Обратите внимание, что угол в 0 радиан это направление от правого края к центру. Это важно для создания нового курсора.
onMove - поворачивает курсор при движении мыши.
auto - поворачивает курсор случайным образом раз в секунду.

Предустановленные курсоры

Стрелка

import { RotatingArrow } from '@feverus/react-custom-cursor'

Лазерная указка

import { LaserDot } from '@feverus/react-custom-cursor'

Текст по окружности

import { CircleWithText } from '@feverus/react-custom-cursor'

<CustomCursor cursor={<CircleWithText text={'any text'} color={'any color'} />}>
   ...
</CustomCursor>
НазваниеТипПо умолчаниюОписание
textstring'...'Текст надписи (до 30 символоов)
colorstring'black'Цвет надписи
donutColorstring'#eeeeee90'Цвет подложки под текстом

Для замены курсора на всей странице

Оберните самый верхний компонент

<CustomCursor cursor={'🦝'}>
   <App />
</CustomCursor>

Возможно, понадобится добавить стиль для него

#root>div {
   width: 100vw;
   min-height: 100vh;
}

Keywords

react custom cursor

FAQs

Package last updated on 25 Sep 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts