# swipes-dot

> Swipes dot

Latest version **0.3.5** (published 2016-07-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install swipes-dot
pnpm add swipes-dot
yarn add swipes-dot
bun add swipes-dot
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.5 |
| Published | 2016-07-02 |
| First published | 2016-03-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Swipes Inc |
| Maintainers | thinklinux |
| Keywords | swipes, dot, react, react-component |

## Links

- npm: https://www.npmjs.com/package/swipes-dot
- Repository: https://github.com/swipesapp/swipes-dot
- Homepage: https://github.com/swipesapp/swipes-dot#readme
- Issues: https://github.com/swipesapp/swipes-dot/issues
- npm.io page: https://npm.io/package/swipes-dot

## Dependencies (1)

- [clone](https://npm.io/package/clone.md) 1.0.2

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.3.5 (latest) — 2016-07-02
- 0.3.4 — 2016-06-23
- 0.3.3 — 2016-05-23
- 0.3.2 — 2016-05-18
- 0.3.1 — 2016-05-15
- 0.3.0 — 2016-05-14
- 0.2.0 — 2016-04-05
- 0.1.5 — 2016-03-28
- 0.1.4 — 2016-03-27
- 0.1.3 — 2016-03-26
- 0.1.2 — 2016-03-26
- 0.1.1 — 2016-03-25
- 0.1.0 — 2016-03-25

## README

##The Swipes dot and radial contextual menu

###Instalation

`npm install swipes-dot --save`

###Usage

```javascript
import React from 'react';
import SwipesDot from 'swipes-dot';

// for radial menu
const elements = [
  {
    label: 'Done',
    icon: 'check',
    callback() {
      console.log('Done!');
    }
  }
]

// for grid menu
const elements = [
  [
    {
      label: 'Done',
      icon: 'check',
      bgColor: 'green',
      callback() {
        console.log('Done!');
      }
    }
  ]
]

<SwipesDot
  hoverParentId='parentId'
  elements={elements} />
```

###Required attributes

**hoverParentId** - the id of the element you want to activate the first stage of the dot on mouse over.

**elements** - the element that are going to be rendered in the radial menu. Every element consists:

  - label - string that explains the action

  - icon - string with a name of a material design icon

  - bgColor - set the background color of the cell (only for the grid menu)

  - callback - a callback function that will be called on click of the element.

###Optional attributes

**radial** - boolean defaults the `false`. Set it to `true` to have the radial menu.

**reverse** - boolean defaults the `false`. Set it to `true` to have the menu items on the left side of the dot.

**showOnHover** - boolean defaults the `false`. Set it to `true` to have the dot hidden until the parent is hovered.

**onDragStart** - a callback function that will be called when the user started dragging the dot.

**style** - inline styles for the root element

###Optional attributes for testing purposes
**menuColors** - This is just for testing the colors for the menu items until we find the right ones. Here is an example:

```javascript
{
  borderColor: 'red',
  hoverBorderColor: '#333ddd',
  backgroundColor: 'white',
  hoverBackgroundColor: 'transparent',
  iconColor: '#333ddd',
  hoverIconColor: 'red'
}
```

**labelStyles** - inline styles for the label

###Dev environment

**npm install**

```
npm install
cd example
npm install
```

**Make an npm link**
From the `root` directory call `npm link`.

From `example` directory call `npm link swipes-dot`.

**Build**

From the root directory call `grunt run` - to watch for changes in the `src` directory and build in `lib`.

---
_Source: https://npm.io/package/swipes-dot · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
