You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
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.0
npmnpm
Version published
Weekly downloads
4
Maintainers
1
Weekly downloads
 
Created
Source

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

Установка

npm i @feverus/react-custom-cursor

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

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

const muCursor = 'любой JSX элемент или строка'

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

Параметры:

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

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

Стрелка

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;
   height: 100vh;
}

Keywords

react custom cursor

FAQs

Package last updated on 22 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