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

@leb90/reactpify

v1.0.1

Published

πŸš€ The easiest way to add React components to any Shopify theme with Vite, Tailwind CSS, and intelligent Liquid auto-generation

Downloads

1

Readme

πŸš€ Reactpify

The easiest way to add React components to any Shopify theme

npm version License: MIT Downloads

Reactpify seamlessly integrates React components into Shopify themes with intelligent Liquid auto-generation, Tailwind CSS, and Vite for the best developer experience.

✨ Features

  • 🎯 Zero Configuration - Works out of the box with any Shopify theme
  • πŸ€– Auto-Generation - Intelligent Liquid template creation from React props
  • πŸ›‘οΈ Manual Edit Detection - Preserves your custom Liquid code automatically
  • 🎨 Tailwind CSS - Built-in styling with component isolation
  • ⚑ Vite Powered - Lightning-fast development with HMR
  • πŸ”„ Redux Ready - State management included
  • πŸ›οΈ Metaobject Support - Native Shopify dynamic content integration
  • πŸ“± Responsive - Mobile-first design principles

πŸš€ Quick Start

Installation

npm install reactpify
# or
yarn add reactpify

Setup

  1. Initialize in your Shopify theme:
npx reactpify init
  1. Start development:
npm run dev
  1. Create your first component:
npx reactpify create welcome-banner

πŸ“ Project Structure

your-shopify-theme/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ welcome-banner/
β”‚   β”‚   β”‚   β”œβ”€β”€ WelcomeBanner.tsx      # React component
β”‚   β”‚   β”‚   └── section.welcome-banner.liquid  # Auto-generated
β”‚   β”‚   └── newsletter-signup/
β”‚   β”‚       β”œβ”€β”€ NewsletterSignup.tsx
β”‚   β”‚       └── section.newsletter-signup.liquid
β”‚   β”œβ”€β”€ main.tsx                       # Entry point
β”‚   └── styles/
β”‚       └── main.css                   # Tailwind CSS
β”œβ”€β”€ vite.config.ts                     # Vite configuration
β”œβ”€β”€ tailwind.config.js                 # Tailwind configuration
└── assets/
    β”œβ”€β”€ reactpify.js                   # Built bundle
    └── reactpify.css                  # Built styles

🎯 Creating Components

1. React Component Example

// src/components/hero-banner/HeroBanner.tsx
import React from 'react';

export interface HeroBannerProps {
  title: string;
  subtitle?: string;
  buttonText: string;
  buttonUrl?: string;
  backgroundColor?: 'primary' | 'secondary' | 'accent';
  showVideo?: boolean;
}

export const HeroBanner: React.FC<HeroBannerProps> = ({
  title = 'Welcome to Our Store',
  subtitle,
  buttonText = 'Shop Now',
  buttonUrl = '#',
  backgroundColor = 'primary',
  showVideo = false
}) => {
  return (
    <div className={`hero-banner bg-${backgroundColor}-600 text-white p-8`}>
      <h1 className="text-4xl font-bold mb-4">{title}</h1>
      {subtitle && <p className="text-xl mb-6">{subtitle}</p>}
      
      <a 
        href={buttonUrl}
        className="btn-primary"
      >
        {buttonText}
      </a>
      
      {showVideo && (
        <div className="mt-8">
          <video autoPlay muted loop className="w-full rounded-lg">
            <source src="/path/to/video.mp4" type="video/mp4" />
          </video>
        </div>
      )}
    </div>
  );
};

2. Auto-Generated Liquid

Reactpify automatically creates this Liquid section:

<!-- Auto-generated section with Shopify admin settings -->
<section class="hero-banner-section" data-component-root="HeroBanner">
  <!-- Fallback content for SEO/loading -->
  <div class="hero-fallback">
    <h1>{{ section.settings.title }}</h1>
    <p>{{ section.settings.subtitle }}</p>
    <a href="{{ section.settings.buttonUrl }}">{{ section.settings.buttonText }}</a>
  </div>
  
  <!-- React component data -->
  <script type="application/json" data-section-data>
    {
      "title": {{ section.settings.title | json }},
      "subtitle": {{ section.settings.subtitle | json }},
      "buttonText": {{ section.settings.buttonText | json }},
      "buttonUrl": {{ section.settings.buttonUrl | json }},
      "backgroundColor": {{ section.settings.backgroundColor | json }},
      "showVideo": {{ section.settings.showVideo }}
    }
  </script>
</section>

{% schema %}
{
  "name": "Hero Banner",
  "settings": [
    {
      "type": "text",
      "id": "title",
      "label": "Title",
      "default": "Welcome to Our Store"
    },
    {
      "type": "textarea",
      "id": "subtitle", 
      "label": "Subtitle"
    },
    {
      "type": "text",
      "id": "buttonText",
      "label": "Button Text",
      "default": "Shop Now"
    },
    {
      "type": "url",
      "id": "buttonUrl",
      "label": "Button URL"
    },
    {
      "type": "select",
      "id": "backgroundColor",
      "label": "Background Color",
      "options": [
        {"value": "primary", "label": "Primary"},
        {"value": "secondary", "label": "Secondary"},
        {"value": "accent", "label": "Accent"}
      ],
      "default": "primary"
    },
    {
      "type": "checkbox",
      "id": "showVideo",
      "label": "Show Video",
      "default": false
    }
  ],
  "presets": [
    {
      "name": "Hero Banner",
      "category": "Banners"
    }
  ]
}
{% endschema %}

πŸ›‘οΈ Manual Edit Protection

Reactpify intelligently detects manual edits and preserves them:

{% comment %} MANUAL EDIT {% endcomment %}
<!-- This file won't be auto-regenerated -->

<section class="custom-hero">
  <!-- Your custom Liquid code here -->
  {% for product in collections.featured.products limit: 3 %}
    <div>{{ product.title }}</div>
  {% endfor %}
</section>

βš™οΈ Configuration

Vite Configuration

// vite.config.ts
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { autoLiquidGenerator } from 'reactpify/vite-plugins/auto-liquid-generator';
import { autoComponentRegistry } from 'reactpify/vite-plugins/auto-component-registry';

export default defineConfig({
  plugins: [
    react(),
    autoLiquidGenerator(),
    autoComponentRegistry()
  ],
  // ... other config
});

Tailwind Configuration

// tailwind.config.js
export default {
  content: [
    "./src/**/*.{js,ts,jsx,tsx}",
    "./sections/**/*.liquid",
    "./snippets/**/*.liquid"
  ],
  corePlugins: {
    preflight: false, // Prevents conflicts with theme CSS
  },
  important: '[data-component-root]', // Scopes to components only
  theme: {
    extend: {
      colors: {
        primary: {
          500: '#3b82f6',
          600: '#2563eb',
          700: '#1d4ed8',
        }
      }
    }
  }
};

πŸ”„ Development Workflow

Watch Mode

npm run watch
  • Auto-regenerates Liquid templates
  • Preserves manual edits
  • Hot-reloads React components

Build for Production

npm run build

Deploy to Shopify

npm run shopify:push

πŸ›οΈ Metaobject Integration

Work with Shopify metaobjects seamlessly:

interface ProductFeatureProps {
  metaobject: {
    title: string;
    description: string;
    features: string[];
    image: string;
  };
}

export const ProductFeature: React.FC<ProductFeatureProps> = ({ metaobject }) => {
  return (
    <div className="product-feature">
      <img src={metaobject.image} alt={metaobject.title} />
      <h3>{metaobject.title}</h3>
      <p>{metaobject.description}</p>
      <ul>
        {metaobject.features.map((feature, index) => (
          <li key={index}>{feature}</li>
        ))}
      </ul>
    </div>
  );
};

πŸ“š CLI Commands

# Initialize Reactpify in existing theme
npx reactpify init

# Create new component
npx reactpify create <component-name>

# Generate Liquid from React component
npx reactpify generate <component-name>

# Clean generated files
npx reactpify clean

🎨 Styling Best Practices

Component Isolation

/* Components are automatically wrapped */
.reactpify-component {
  isolation: isolate;
  /* Your component styles won't leak */
}

Tailwind Usage

// βœ… Good - Scoped to component
<div className="bg-blue-500 text-white p-4 rounded-lg">
  Content
</div>

// βœ… Good - Custom utility classes
<div className="btn-primary card-gradient">
  Content  
</div>

🚨 Troubleshooting

Common Issues

CSS not loading:

<!-- Ensure this is in your theme.liquid -->
<link rel="stylesheet" href="{{ 'reactpify.css' | asset_url }}">
<script type="module" src="{{ 'reactpify.js' | asset_url }}"></script>

Component not rendering:

  • Check browser console for errors
  • Verify component is registered in main.tsx
  • Ensure data-component-root attribute matches component name

Build errors:

  • Run npm run clean and rebuild
  • Check for TypeScript errors
  • Verify all imports are correct

πŸ“ Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

MIT Β© Reactpify

πŸ™ Acknowledgments


Made with ❀️ for the Shopify community

⭐ Star this repo if you find it helpful!