Skip to content
This repository was archived by the owner on May 12, 2026. It is now read-only.

Repository files navigation

react-alignment-guides

React Alignment Guides is a guides system for draggable elements in an enclosed space

NPMJavaScript Style Guide

Install

NPM

npm install --save react-alignment-guides

Usage

importReact,{Component}from'react'importAlignmentGuidesfrom'react-alignment-guides'classExampleextendsComponent{render(){return(<AlignmentGuides{...props}/>)}}

Props

PropRequiredDefaultDescription
boxestrue[]An array of box objects
boxStylefalse{}Styles to be applied to the boxes. It should follow the convention described here.
classNamefalseempty stringCSS classes. Note: Do not override position
onDragStartfalseFunction to call when drag starts
onDragfalseFunction to call during drag
onDragEndfalseFunction to call when drag ends
onKeyUpfalseFunction to call for keystrokes
onResizeStartfalseFunction to call when resize starts
onResizefalseFunction to call during resize
onResizeEndfalseFunction to call when resize ends
onSelectfalseFunction to call when a box is clicked
onUnselectfalseFunction to call when a box goes inactive
onSecondaryClickfalseFunction to call when right clicking on single or multiple boxes
resolutionfalsenullResolution to which you want to scale the boxes to. For example, the bounding box can be 1280x720 but you can display the coordinates and dimensions relative to 1920x1080. In this case, resolution would be set to { width: 1920, height: 1080 }.
stylefalsenullStyles to be applied to the component. It should follow the convention described here. Note: Do not override position

Box object

PropDefaultDescription
dragtrueBoolean. Allow or disallow dragging for this box
resizetrueBoolean. Allow or disallow resizing for this box
rotatetrueBoolean. Allow or disallow rotating for this box
xNumber
yNumber
leftNumber
topNumber
widthNumber
heightNumber
rotateAngleNumber in the range -180 to 180

License

Apache-2.0 © Rocketium

About

No description, website, or topics provided.

Resources

Stars

17 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages