Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@atayahmet/react-slidify

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@atayahmet/react-slidify

React Slidify is a component that transmits position coordinates of element with callbacks.

  • 1.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
decreased by-77.27%
Maintainers
1
Weekly downloads
 
Created
Source

npm version Build Status

React Slidify

React Slidify

React Slidify is a component that transmits position coordinates with callbacks at each step of an object that you can advance by dragging within a field. The component can be use as volume control, music player timeline etc.

Installation

Use the package manager yarn or npm to install react-slidify.

npm i @atayahmet/react-slidify --save
yarn add @atayahmet/react-slidify

Usage

import Slidify from '@atayahmet/react-slidify';

<Slidify
  width="250px"
  height="250px"
  points={[
    {
      x={10}
      y={300}
      width={20}
      height={20}
    }
  ]}
  axis="xy"
  onSlide={callback}
/> 

Props

ISlidifyOptions

nametypedefaultdescription
widthstring100%Width of the field.
heightstring100%Height of the field.
pointsIPoint[][]
multiplebooleanfalseMultiple points.
movablebooleantrueThe points can move or vice versa.
axisstringxyAvailable axes.
defaultBackgroundColorOfPointstringredDefault background color of point.
onStartonStartHandlerArgs-First move event.
onStoponStopHandlerArgs-Last move event.
onSlideonSlideHandlerArgs-Active slide event.
onReachonReachHandlerArgs-Reach point event.

IPoint

nametypedefaultdescription
xnumber-Left position px value.
ynumber-Top position px value.
widthnumberinnerWidthWidth of the point in px.
heightnumberinnerHeightHeight of the point in px.
classNamestring (optional)-Custom class name.
styleReact.CSSProperties (optional)-Css properties.
childrenJSX ElementnullPass JSX element to points.

IEventPoint

nametypedescription
xnumberLeft position px value.
ynumberTop position px value.
widthnumberWidth of the point in px.
heightnumberHeight of the point in px.
axisstringCurrent axis.
percentIPercentX and Y position as percent unit

IPercent

nametypedescription
xnumberLeft position percent value.
ynumberTop position percent value.

Events

nameargumentsdescription
onStartonStartHandlerArgsFirst move event.
onStoponStopHandlerArgsLast move event.
onSlideonSlideHandlerArgsActive slide event.
onReachonReachHandlerArgsReach point event.

Types

onStartHandlerArgs

(point: IEventPoint, index: number) => any

onStopHandlerArgs

(point: IEventPoint, index: number) => any

onSlideHandlerArgs

(point: IEventPoint, index: number) => any

onReachHandlerArgs

(point: IEventPoint, at: ReachPoint, index: number) => any

ReachPoint

'start-point' | 'end-point'

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT

Keywords

FAQs

Package last updated on 05 Sep 2020

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