# Installation [![module formats: umd, cjs, and esm](https://img.shields.io/badge/module%20formats-umd%2c%20cjs%2c%20esm-green.svg?style=flat)](https://unpkg.com/@hello-pangea/dnd/dist/) ## General 1. Add the `@hello-pangea/dnd` package ```bash # npm npm install @hello-pangea/dnd --save # pnpm pnpm add @hello-pangea/dnd # yarn yarn add @hello-pangea/dnd ``` 2. Use the package ```js import { DragDropContext } from '@hello-pangea/dnd'; ``` 3. Profit 🕺 ## `React` environment In order to use `@hello-pangea/dnd` you will probably want to have a `React` environment set up. - [Add react to a website](https://reactjs.org/docs/add-react-to-a-website.html) - official `React` docs - [Setup a react environment with `create-react-app`](https://egghead.io/lessons/react-set-up-a-react-environment-with-create-react-app) - from our [free getting started course](https://egghead.io/courses/beautiful-and-accessible-drag-and-drop-with-react-beautiful-dnd) (This is using [react-beautiful-dnd](https://github.com/atlassian/react-beautiful-dnd)) ## Distribution bundle A [universal module definition](https://github.com/umdjs/umd) bundle is published on `npm` under the `/dist` folder for consumption . We publish the following files: - `dist/dnd.js` - `dist/dnd.min.js` (minified bundle) These bundles list `react` as an external which needs to be provided. This is done to reduce the size of the bundle and prevent consumers from loading `react` multiple times. You can provide `react` through your module system or simply by having `react` on the `window`. You can use the UMD to run `@hello-pangea/dnd` directly in the browser. ```html ``` There is also an [example codepen](https://codepen.io/alexreardon/project/editor/ZyNMPo) you can use to play with this installation method. ## [`ClojureScript`](https://clojurescript.org/) You can consume `@hello-pangea/dnd` from within `ClojureScript` using [CLJSJS](https://cljsjs.github.io/)! [← Back to documentation](/README.md#documentation-)