Socket
Socket
Sign inDemoInstall

swipes-dot

Package Overview
Dependencies
1
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    swipes-dot

Swipes dot


Version published
Maintainers
1
Created

Readme

Source

##The Swipes dot and radial contextual menu

###Instalation

npm install swipes-dot --save

###Usage

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:

{
  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.

Keywords

FAQs

Last updated on 02 Jul 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc