Socket
Socket
Sign inDemoInstall

react-radial

Package Overview
Dependencies
59
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-radial

a radial component built with react and resonance


Version published
Weekly downloads
1
Maintainers
1
Created
Weekly downloads
 

Readme

Source

react-radial

By Mode Lab

Intro

This is a straightforward, customizable radial menu, built with React and Resonance (a library that allows React and D3js to play along nicely).

The radial component is built with SVG, and can be ported into a div, canvas, WebGL scene, etc. We use radial menus for 3D interaction often, and decided to build a generic component for future use. The demo file is an interactive environment for defining how you want the radial menu to look. Check it out here.

demo

Getting Started

Install the component into your project

npm install --save react-radial

Load the component into your app

import React from 'react';
import { ReactRadial } from 'react-radial';

class Component extends React.Component {
  render() {
    return <ReactRadial />;
  }
}

Remmeber to click on your canvas/div after loading the page (the radial menu does not load automatically). Please post any issues.

react-radial attributes

NameTypeDefaultDescription
buttonsarray["button1",...(5)]an array of strings representing each button's label
buttonFunctionsarray[() => console.log('clicked button 1'),...(5)]an array of functions triggered by clicking each button
durationnumber (ms)400duration of transition
delaynumber (ms)80delay per button in transition
innerRadiusnumber (px)20donut hole size
outerRadiusnumber (px)120distance from outside of donut hole to outside of donut
strokeWidthnumber2stroke width
strokecolor'rgba(255,255,255,1)'stroke color
fillcolor'rgba(0,0,0,.8)'fill color

Keywords

FAQs

Last updated on 29 Jul 2017

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