npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@robinticistjs/roulette

v0.1.4

Published

This is a roulette component for React and Next.js

Readme

@robinticistjs/roulette

A customizable roulette component library for React and Next.js implemented with pure CSS.

Installation

# Using pnpm (recommended)
pnpm add @robinticistjs/roulette

# Using npm
npm install @robinticistjs/roulette

# Using yarn
yarn add @robinticistjs/roulette

Dependencies

This component is implemented with pure CSS without relying on external CSS frameworks. No additional style dependencies are required.

Demo

Spin the roulette wheel

Features

  • 🎡 Animated spinning roulette wheel
  • 🎯 Customizable design
  • 🔄 Async event handling support
  • 📱 Responsive design
  • ⚡ Perfect compatibility with Next.js and React
  • 🚀 Pure CSS implementation without external dependencies

Usage

Basic Example

import { Roulette } from '@robinticistjs/roulette';

function MyComponent() {
    // Fetch results from server or other operations
    // You can determine the weighting of the results either on the server or here.
    const handleSpinStart = async () => {
    return Math.floor(Math.random() * 10);
  };

  const handleSpinEnd = (value: number) => {
    console.log('Spin ended with value:', value);
  };
  return (
    <Roulette
      items={[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]}
      onSpinStart={handleSpinStart}
      onSpinEnd={handleSpinEnd}
    />
  );
}

Props

| Property | Type | Required | Default | Description | |----------|------|----------|---------|-------------| | items | number[] | Required | - | Array of items to display on the roulette | | onSpinStart | () => Promise<number> | Optional | - | Function called when spinning starts, should return the winning item index | | onSpinEnd | (value: number) => void | Optional | - | Function called when spinning ends | | disabled | boolean | Optional | false | Whether the roulette is disabled | | remainSecond | number | Optional | 0 | Remaining time (timestamp) | | width | string | Optional | 330px | Width of the roulette | | height | string | Optional | 330px | Height of the roulette | | outerBorderColor | string | Optional | #e12afb | Color of the outer border | | dotColor | string | Optional | #ffdf20 | Color of the dots | | dotBorderColor | string | Optional | #9ca3af | Color of the dot borders | | markerColor | string | Optional | #F44225 | Color of the marker arrow | | buttonBorderColor | string | Optional | #f87171 | Color of the button border | | buttonBgColor | string | Optional | #ff4d4d | Color of the button background | | buttonHoverBorderColor | string | Optional | #ef4444 | Color of the button border on hover | | buttonHoverBgColor | string | Optional | #dc2626 | Color of the button background on hover | | buttonDisabledBgColor | string | Optional | #b91c1c | Color of the button background when disabled | | sectionColors | [string, string] | Optional | ['#ffffff', '#e5e7eb'] | Colors for even and odd sections | | textColor | string | Optional | #000000 | Color of the text |

Styling

Styling Methods

This component can be styled in two ways:

Method 1: Automatic Style Application

When you import the component, the default styles are automatically applied.

import { Roulette } from '@robinticistjs/roulette';

function MyComponent() {
  return <Roulette items={[1, 2, 3, 4, 5]} />;
}

Method 2: Direct Style Import

If you want to control the styles directly, you can explicitly import the CSS file.

// Import styles in your application's top-level file
import '@robinticistjs/roulette/styles.css';
import { Roulette } from '@robinticistjs/roulette';

function MyComponent() {
  return <Roulette items={[1, 2, 3, 4, 5]} />;
}

Color Customization Example

You can easily customize the colors of the roulette component through props:

import { Roulette } from '@robinticistjs/roulette';

function MyComponent() {
  return (
    <Roulette
      items={[1, 2, 3, 4, 5]}
      width="400px"
      height="400px"
      outerBorderColor="#3b82f6"
      dotColor="#fbbf24"
      markerColor="#ef4444"
      buttonBgColor="#10b981"
      buttonBorderColor="#059669"
      sectionColors={['#f9fafb', '#e5e7eb']}
    />
  );
}

Development

# Install dependencies
pnpm install

# Run development server
pnpm dev

# Build
pnpm build

# Watch mode for automatic rebuilds
pnpm build:watch

License

MIT