package
Drop content anywhere on the page.
npm install react-dropGitHub-flavored package documentation.
Across all versions, last 30 days.
60 in 30 days
Runtime metadata.
Tagged topics.
Drop content anywhere on the page.
npm install react-drop --save
bower install react-drop --save
import Drop from 'react-drop';
class App extends Component {
state = {
isOpen: false
}
render() {
return(
<div>
<button
ref="trigger"
onClick={() => {this.setState({})}}
>
Trigger Content
</button>
<Drop
target={this.refs.trigger}
position="top"
align="middle"
>
<div>
<h2>Dropped Content</h2>
<p>A paragraph to accompany the title.</p>
</div>
</Drop>
</div>
)
}
}target: PropTypes.objectAccepts a DOM node which the Drop component is attached to. If getting undefined when using refs, try adding forceUpdate inside your trigger component's did mount lifecycle.
position: PropTypes.stringThe position of the Drop component. Accepts top, right, bottom, or left.
align: PropTypes.stringHow the Drop component is aligned. Accepts left, middle, right, top, or bottom.
offset: PropTypes.shape({top: PropTypes.number, left: PropTypes.number})Adjust the top and/or left offset of where the content is dropped.
clone repo
git clone git@github.com:souporserious/react-drop.git
move into folder
cd ~/react-drop
install dependencies
npm install
run dev mode
npm run dev
open your browser and visit: http://localhost:8080/
Estimated unpacked size across 10 packages.
8.1 MB
Includes dependencies.
4 direct · 3 outdated
^0.14.1
19.3.1
^0.14.1
19.3.1
^1.1.1
1.3.6
^0.14.1
15.6.3