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

antd-rails-ui

v1.0.0-alpha

Published

Ant Design Components for use with StimulusJS and Rails applications

Downloads

4

Readme

Ant Design for Rails

A React-based UI component library that integrates Ant Design components with Rails applications using StimulusJS and turbo-mount.

Installation

1. Install the library

npm install antd-rails-ui

2. Add CDN dependencies

Add these CDN links to your Rails layout before your application JavaScript:

<!-- app/views/layouts/application.html.erb -->
<head>
  <!-- React CDN -->
  <script crossorigin src="https://cdn.jsdelivr.net/npm/react@19/umd/react.production.min.js"></script>
  <script crossorigin src="https://cdn.jsdelivr.net/npm/react-dom@19/umd/react-dom.production.min.js"></script>

  <!-- Ant Design CDN -->
  <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/antd.min.js"></script>
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/reset.css">

  <!-- TurboMount CDN -->
  <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/turbo-mount.min.js"></script>

  <!-- Your app assets -->
  <%= vite_client_tag %>
  <%= vite_javascript_tag 'application' %>
</head>
```#### Alternative CDN Options

**For development (unminified versions):**
```html
<!-- React Development -->
<script crossorigin src="https://cdn.jsdelivr.net/npm/react@19/umd/react.development.js"></script>
<script crossorigin src="https://cdn.jsdelivr.net/npm/react-dom@19/umd/react-dom.development.js"></script>

<!-- Ant Design Development -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/antd.js"></script>

<!-- TurboMount Development -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/turbo-mount.js"></script>

Import Maps (for modern bundlers):

<script type="importmap">
{
  "imports": {
    "react": "https://cdn.jsdelivr.net/npm/react@19/+esm",
    "react-dom": "https://cdn.jsdelivr.net/npm/react-dom@19/+esm",
    "antd": "https://cdn.jsdelivr.net/npm/[email protected]/+esm",
    "turbo-mount": "https://cdn.jsdelivr.net/npm/[email protected]/+esm"
  }
}
</script>

3. Initialize in your application

// app/javascript/controllers/application.js
import { Application } from "@hotwired/stimulus"
import { registerComponents } from 'antd-rails-ui'

const application = Application.start()

// Register all components
registerComponents(application)

Usage

Basic Select Component

<div data-controller="select"
     data-select-props-value='{
       "options": [
         {"value": "1", "label": "Option 1"},
         {"value": "2", "label": "Option 2"}
       ],
       "name": "my_select"
     }'>
  <input type="hidden" data-select-target="input" name="my_select">
  <div data-select-target="mount"></div>
  <div data-select-target="hiddenInputs"></div>
</div>

Multiple Selection

<div data-controller="select"
     data-select-props-value='{
       "options": [
         {"value": "1", "label": "Option 1"},
         {"value": "2", "label": "Option 2"}
       ],
       "name": "my_select",
       "mode": "multiple"
     }'>
  <input type="hidden" data-select-target="input" name="my_select">
  <div data-select-target="mount"></div>
  <div data-select-target="hiddenInputs"></div>
</div>

Theming

import { initializeTheme } from 'antd-rails-ui'

// Initialize with custom theme
initializeTheme({
  theme: {
    token: {
      colorPrimary: '#1890ff',
      colorSuccess: '#52c41a',
      colorWarning: '#faad14',
      colorError: '#f5222d'
    }
  }
})

Extending Components

See EXTENDING.md for detailed information on how to extend and customize components.

API Reference

Components

  • SelectComponent - Ant Design Select component wrapper
  • SelectController - Stimulus controller for Select component

Functions

  • registerComponents(application, options) - Register all components
  • initializeTheme(options) - Initialize theme configuration
  • initializeUI(application, options) - One-stop initialization

Utilities

  • withTheme(Component) - HOC for theme integration
  • registerComponent - Re-exported from turbo-mount/react

Requirements

  • React 18+ or 19+
  • StimulusJS 3+
  • Rails 7+ (recommended)

License

MIT