Package Exports
- @uiw/react-drag-event-interactive
- @uiw/react-drag-event-interactive/cjs/index.js
- @uiw/react-drag-event-interactive/esm/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@uiw/react-drag-event-interactive) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
React Drag Event Interactive
Interactive Component is a subcomponent of @react-color
.
Install
npm i @uiw/react-drag-event-interactive
Usage
import Interactive from '@uiw/react-drag-event-interactive';
function Demo() {
return (
<Interactive hsva={{ h: 0, s: 75, v: 82, a: 1 }} />
);
}
Props
import React from 'react';
export declare function useEventCallback<T, K>(handler?: (value: T, event: K) => void): (value: T, event: K) => void;
export declare const isTouch: (event: MouseEvent | TouchEvent) => event is TouchEvent;
export declare const preventDefaultMove: (event: MouseEvent | TouchEvent) => void;
export declare const clamp: (number: number, min?: number, max?: number) => number;
export interface Interaction {
left: number;
top: number;
width: number;
height: number;
x: number;
y: number;
}
export declare const getRelativePosition: (node: HTMLDivElement, event: MouseEvent | TouchEvent) => Interaction;
export interface InteractiveProps extends React.HTMLAttributes<HTMLDivElement> {
prefixCls?: string;
onMove?: (interaction: Interaction, event: MouseEvent | TouchEvent) => void;
onDown?: (offset: Interaction, event: MouseEvent | TouchEvent) => void;
}
License
Licensed under the MIT License.