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

react-input-with-drag

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-input-with-drag

Lightweight, zero-dependency, number input component with mouse drag actions just like in Blender and 3D Studio Max.

  • 1.1.6
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

💄 React input with drag

Lightweight, zero-dependency, number input component with mouse drag actions just like in Blender and 3D Studio Max.

Install

npm install --save react-input-with-drag

Usage

import InputWithDrag from 'react-input-with-drag';
import type { InputWithDragChangeHandler } from 'react-input-with-drag';

function App() {
  const handleChange: InputWithDragChangeHandler = value => {
    // fired on input change and drag end
  };

  const handleInput: InputWithDragChangeHandler = value => {
    // fired on every input change, including every pixel dragged
  };

  return (
    <InputWithDrag value={100} onChange={handleChange} onInput={handleInput} />
  );
}

Properties

Since react-input-with-drag overloads a regular HTML input, all the typical properties are accepted, like onChange, onInput, step, min, and max. Being a React component, you can override the styles with either style or className as well.

Additionally, these are props to customise react-input-with-drag:

propdefaultdescription
modifiers{ shiftKey: 0.1 }Sets the precision of a drag when a modifier key is pressed

Note

A modifier takes the step property into account. If step is 0.1, the default shift key will add/subtract by 0.01

Read more

  • NPM

Keywords

FAQs

Package last updated on 23 Apr 2024

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