New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@solid-primitives/cursor

Package Overview
Dependencies
Maintainers
3
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@solid-primitives/cursor

Two simple primitives for setting cursor css property reactively.

  • 0.0.112
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
11K
increased by2.43%
Maintainers
3
Weekly downloads
 
Created
Source

Solid Primitives cursor

@solid-primitives/cursor

turborepo size version stage

Two simple primitives for setting cursor css property reactively.

Installation

npm install @solid-primitives/cursor
# or
yarn add @solid-primitives/cursor
# or
pnpm add @solid-primitives/cursor

createElementCursor

Set provided cursor to given HTML Element styles reactively.

It takes two arguments:

  • element - HTMLElement or a reactive signal returning one. Returning falsy value will unset the cursor.
  • cursor - Cursor css property. E.g. "pointer", "grab", "zoom-in", "wait", etc.
import { createElementCursor } from "@solid-primitives/cursor";

const target = document.querySelector("#element");
const [cursor, setCursor] = createSignal("pointer");
const [enabled, setEnabled] = createSignal(true);

createElementCursor(() => enabled() && target, cursor);

setCursor("help");

createBodyCursor

Set selected cursor to body element styles reactively.

It takes only one argument:

  • cursor - Signal returing a cursor css property. E.g. "pointer", "grab", "zoom-in", "wait", etc. Returning falsy value will unset the cursor.
import { createBodyCursor } from "@solid-primitives/cursor";

const [cursor, setCursor] = createSignal("pointer");
const [enabled, setEnabled] = createSignal(true);

createBodyCursor(() => enabled() && cursor());

setCursor("help");

Changelog

See CHANGELOG.md

Keywords

FAQs

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc