GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - TzviPM/draggable-react: React components for Shopify's draggable

BranchesTags
Open more actions menu

Latest commit

 

History

36 Commits
36 Commits

Folders and files

NameName
Last commit message
Last commit date
.vscode
.vscode
 
 
src
src
 
 
types/draggable
types/draggable
 
 
.gitignore
.gitignore
 
 
.npmignore
.npmignore
 
 
CHANGELOG.md
CHANGELOG.md
 
 
CODE_OF_CONDUCT.md
CODE_OF_CONDUCT.md
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE.md
LICENSE.md
 
 
README.md
README.md
 
 
_config.yml
_config.yml
 
 
package.json
package.json
 
 
tsconfig.json
tsconfig.json
 
 
yarn.lock
yarn.lock
 
 

Repository files navigation

draggable-react

React components for Shopify's draggable

Table of Contents

  • Installation
  • Usage
  • Contribute
  • License
  • Changelog

Installation

$ yarn add draggable-react

Usage

This library is still a work in progress. Currently, we expose 3 APIs:

  1. A DraggableProvider component
  2. A DraggableContainer component
  3. A withDraggable higher-order component

Basic example

To start off, we can use the containerized variant of the DraggableProvider, which automatically creates a default DraggableContainer around our app. Simply replace your main <App /> component with some thing like this:

<DraggableProvider containerized>
  <App />
</DraggableProvider> 

Next, wrap whichever components you wish to make draggable with the HOC, then consume the draggable prop and use its className. For example:

const DraggableDiv = withDraggable()(({draggable, children}) => (
  <div className={draggable.className}>
    {children}
  </div>
));

If you want the supplied prop to have a name other than draggable, you can specify that in the options. For example:

const DraggableDiv = withDraggable({prop: 'drag'})(({drag, children}) => (
  <div className={drag.className}>
    {children}
  </div>
));

Contribute

Check out our Contributing Guidelines

License

MIT, see LICENSE.md for details.

About

React components for Shopify's draggable

omniroot.github.io/draggable-react/

Resources

Readme
MIT license

Code of conduct

Code of conduct

Contributing

Contributing
Activity

Stars

2 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.