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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@roketin-library/r-component

v1.0.1

Published

CLI to install react R-components from the Roketin component library

Readme

R-Component CLI

A CLI tool to install Roketin R components into your React project, similar to shadcn/ui.

Installation

# Using npx (recommended)
npx r-component init

# Or install globally
npm install -g r-component

Quick Start

1. Initialize your project

npx r-component init

This creates a r-component.json config file in your project root:

{
  "$schema": "https://raw.githubusercontent.com/roketin/r-component/main/config-schema.json",
  "baseDir": "src/components",
  "componentsDir": "base",
  "libsDir": "libs",
  "typescript": true,
  "aliases": {
    "components": "@/components",
    "libs": "@/libs"
  },
  "registry": "https://raw.githubusercontent.com/roketin/r-component/main/registry.json"
}

2. Add components

# Add a single component
npx r-component add button

# Add multiple components
npx r-component add card input select

# Add all components
npx r-component add --all

# Interactive selection
npx r-component add

3. List available components

npx r-component list

# Output as JSON
npx r-component list --json

Commands

init

Initialize r-component configuration in your project.

npx r-component init [options]

Options:

  • -y, --yes - Skip prompts and use defaults
  • -c, --cwd <path> - Specify working directory

add

Add component(s) to your project.

npx r-component add [components...] [options]

Options:

  • -y, --yes - Skip confirmation prompts
  • -o, --overwrite - Overwrite existing files
  • -c, --cwd <path> - Specify working directory
  • -a, --all - Add all available components

Examples:

npx r-component add r-btn
npx r-component add r-card r-input r-select
npx r-component add --all --overwrite

list

List all available components in the registry.

npx r-component list [options]

Options:

  • --json - Output as JSON

Configuration

The r-component.json file controls where components are installed:

| Option | Description | Default | |--------|-------------|---------| | baseDir | Base directory for components | src/components | | componentsDir | Subdirectory for component files | base | | libsDir | Directory for utility files | libs | | typescript | Use TypeScript files | true | | aliases.components | Import alias for components | @/components | | aliases.libs | Import alias for libs | @/libs | | registry | Component registry URL | GitHub raw URL |

How It Works

  1. Registry: Components are defined in a registry.json file hosted on GitHub
  2. Dependencies: Each component specifies its file dependencies and npm packages
  3. Transform: Import paths are automatically transformed to match your config
  4. Skip Existing: Files that already exist are skipped (use --overwrite to replace)

Component Dependencies

When you add a component, the CLI automatically resolves and installs:

  • Component files - The main component TSX file
  • Lib files - Required utility files (utils.ts, ui-variants.ts, etc.)
  • Component dependencies - Other R components this component depends on
  • NPM packages - Required npm packages (shown after install)

Directory Structure

After installing components, your project will look like:

src/
├── components/
│   └── base/           # R components go here
│       ├── r-btn.tsx
│       ├── r-card.tsx
│       └── ...
└── libs/               # Utility files go here
    ├── utils.ts
    └── ui-variants.ts

Publishing Your Own Registry

You can host your own component registry by:

  1. Create a public GitHub repository
  2. Add component files in a components/ folder
  3. Add lib files in a libs/ folder
  4. Create a registry.json file
  5. Update the registry URL in r-component.json

Requirements

  • Node.js 18+
  • React 18+
  • Tailwind CSS (for styling)

License

MIT