New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-spinning-canvas-wheel

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-spinning-canvas-wheel

![Wheel](docs/wheel.png)

  • 0.1.4
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
5
increased by66.67%
Maintainers
1
Weekly downloads
 
Created
Source

React Spinning Canvas Wheel

Wheel

Features

  • Zero dependencies
  • Written in TypeScript
  • High DPI screens support
  • SSR support
  • Customizable timing function

Installation

npm i react-spinning-canvas-wheel
yarn add react-spinning-canvas-wheel

Usage

import { useRef } from 'react';
import SpinningWheel, {
  SpinningWheelRef,
  WheelSegment,
} from 'react-spinning-canvas-wheel';

const SEGMENTS: WheelSegment[] = [
  { title: 'Metal Gear Solid' },
  { title: 'Dark Souls 2' },
  { title: 'Escape From Tarkov' },
  { title: 'It Takes Two' },
  { title: 'Resident Evil Village' },
];

const Wheel = () => {
  const spinningWheelRef = useRef<SpinningWheelRef>();

  return (
    <div>
      {/* startSpinning(secondsToSpin: number, speed: number) */}
      <button onClick={() => spinningWheelRef.current.startSpinning(30, 4)}>
        Start
      </button>
      <button onClick={() => spinningWheelRef.current.stopSpinning()}>
        Stop
      </button>
      <SpinningWheel
        size={640}
        segments={SEGMENTS}
        spinningWheelRef={spinningWheelRef}
        onSegmentChange={(index) => console.log('currentSegmentIndex:', index)}
        onSpinStart={() => console.log('started')}
        onSpinEnd={(winnerIndex) => console.log('winnerIndex:', winnerIndex)}
      />
    </div>
  );
};

FAQs

Package last updated on 08 Nov 2021

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc