Skip to main content

Installation Methods

React Wheel Picker can be installed in two ways: via shadcn/ui for a quick setup with pre-styled components, or as a primitives package for complete control over styling.

shadcn/ui

Quick setup with shadcn CLI and pre-configured styling

Primitives

Unstyled components with full customization control

Install via shadcn/ui

The easiest way to get started is using the shadcn CLI. This automatically adds the component to your project with pre-configured styling.
npx shadcn add @ncdai/wheel-picker
This command will:
  • Install the @ncdai/react-wheel-picker package
  • Add the component files to your components/ directory
  • Configure default styling that works with your shadcn/ui theme

Configure shadcn MCP Server (Optional)

Enable AI assistants to understand your component registry:
npx shadcn mcp init
Learn more about the shadcn MCP server and how it helps AI assistants work with your components.

Example AI Prompts

Once configured, you can use prompts like:
  • “Create a wheel picker demo from the ncdai registry”
  • “Create a wheel picker form demo from the ncdai registry”

Import and Use

After installation, import the components from your local components directory:
import {
  WheelPicker,
  WheelPickerWrapper,
  type WheelPickerOption,
} from "@/components/wheel-picker";

Basic Usage

import { useState } from "react";
import {
  WheelPicker,
  WheelPickerWrapper,
  type WheelPickerOption,
} from "@/components/wheel-picker";

const options: WheelPickerOption[] = [
  { label: "Next.js", value: "nextjs" },
  { label: "Vite", value: "vite" },
  { label: "Remix", value: "remix" },
];

export function WheelPickerDemo() {
  const [value, setValue] = useState("nextjs");

  return (
    <WheelPickerWrapper>
      <WheelPicker
        options={options}
        value={value}
        onValueChange={setValue}
      />
    </WheelPickerWrapper>
  );
}

Package Details

The package supports both CommonJS and ES modules:
  • CommonJS: dist/index.js
  • ESM: dist/index.mjs
  • TypeScript: Full type definitions included
React Wheel Picker requires React 16.8 or higher:
{
  "react": "^16.8 || ^17.0 || ^18.0 || ^19.0.0"
}

Verify Installation

To verify the installation was successful, create a simple test component:
app/test-picker.tsx
import { useState } from "react";
import {
  WheelPicker,
  WheelPickerWrapper,
  type WheelPickerOption,
} from "@ncdai/react-wheel-picker";

const testOptions: WheelPickerOption[] = [
  { label: "Option 1", value: "1" },
  { label: "Option 2", value: "2" },
  { label: "Option 3", value: "3" },
];

export function TestPicker() {
  const [value, setValue] = useState("1");

  return (
    <div>
      <h2>Selected: {value}</h2>
      <WheelPickerWrapper>
        <WheelPicker
          options={testOptions}
          value={value}
          onValueChange={setValue}
        />
      </WheelPickerWrapper>
    </div>
  );
}
If the component renders without errors, the installation is successful!

Next Steps

Quick Start Guide

Learn how to build your first wheel picker

API Reference

Explore all available props and options

Examples

See real-world examples and use cases

TypeScript Support

Learn about type definitions and generics

Build docs developers (and LLMs) love