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

reactpifyjs

v1.0.25

Published

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

Downloads

36

Readme

πŸš€ Reactpify

The ultimate React integration library for Shopify themes. Build modern, interactive components with React while maintaining perfect SEO and theme compatibility.

✨ Features

πŸ”„ Automatic Liquid Generation

  • React β†’ Liquid: Automatically generates Shopify Liquid templates from your React components
  • SEO-friendly fallbacks: HTML shells rendered server-side for perfect SEO
  • Theme Editor compatibility: Components work seamlessly in Shopify's theme customizer

🎨 Intelligent Theme Integration

  • Automatic Style Analysis: Detects and extracts original theme styles
  • Perfect Scoping: CSS automatically scoped to avoid conflicts with existing theme
  • Tailwind Integration: Full Tailwind CSS v4 support with theme-aware configuration

πŸ‘€ Bidirectional Watch System

  • React β†’ Liquid Sync: Changes in React components automatically update Liquid files
  • Manual Edit Detection: Detects when Liquid files are manually modified
  • Real-time Updates: Vite-powered development with instant hot reloading

🧩 Fragment System

  • Reusable Snippets: Share common Liquid schema fragments across components
  • Auto-injection: Fragments automatically injected during build process
  • Extensible: Easy to add custom fragments for your specific needs

πŸ“‹ Prerequisites

Reactpify installs ON TOP of existing Shopify themes. Before installing, you need:

πŸͺ Existing Shopify Theme

  • A working Shopify theme directory with these folders:
    your-theme/
    β”œβ”€β”€ assets/
    β”œβ”€β”€ layout/
    β”œβ”€β”€ sections/
    β”œβ”€β”€ snippets/
    └── templates/

🎯 Compatible Themes

  • βœ… Dawn (Shopify's free theme)
  • βœ… Horizon (Latest Shopify theme)
  • βœ… Any modern Shopify theme (Online Store 2.0+)
  • βœ… Custom themes with standard structure

πŸš€ How to Get a Shopify Theme

Option 1: Download from your Shopify store

# Install Shopify CLI
npm install -g @shopify/cli @shopify/theme

# Download your live theme
shopify theme pull

# Or start with Dawn (free theme)
shopify theme init my-theme --clone-url="https://github.com/Shopify/dawn"

Option 2: Use an existing theme directory If you already have a Shopify theme folder, navigate to it:

cd your-existing-theme/
# Now you can install Reactpify

πŸš€ Quick Start

Installation

⚠️ Important: Run this command INSIDE your Shopify theme directory

cd your-theme-folder/
npm install reactpifyjs

Reactpify will automatically:

  • βœ… Detect your Shopify theme
  • βœ… Install all necessary files
  • βœ… Update layout/theme.liquid
  • βœ… Create example components
  • βœ… Set up the build system

Basic Usage

  1. Create a React Component
// src/components/hello/Hello.tsx
import React, { useState } from 'react';

interface HelloProps {
  title?: string;
  showButton?: boolean;
}

export const Hello: React.FC<HelloProps> = ({
  title = "Hello World",
  showButton = true
}) => {
  const [clicked, setClicked] = useState(false);

  return (
    <div className="reactpify-container max-w-md mx-auto p-6">
      <div className="bg-blue-500 text-white p-6 rounded-lg shadow-lg text-center">
        <h1 className="text-2xl font-bold mb-4">{title}</h1>
        
        {showButton && (
          <button 
            onClick={() => setClicked(!clicked)}
            className="bg-white text-blue-500 px-4 py-2 rounded hover:bg-gray-100 transition-colors font-semibold"
          >
            {clicked ? 'βœ… Clicked!' : 'πŸ‘‹ Click me'}
          </button>
        )}
      </div>
    </div>
  );
};
  1. Create the Liquid Template
<!-- src/components/hello/section.hello.liquid -->
{% comment %}
Auto-generated by Reactpify
Component: Hello
{% endcomment %}

<div data-component-root data-section-data='{{ section | json | escape }}'>
  <div data-fallback>
    <div class="max-w-md mx-auto p-6">
      <div class="bg-blue-500 text-white p-6 rounded-lg shadow-lg text-center">
        <h1 class="text-2xl font-bold mb-4">{{ section.settings.title | default: 'Hello World' }}</h1>
        
        {% if section.settings.show_button %}
          <button class="bg-white text-blue-500 px-4 py-2 rounded font-semibold">
            πŸ‘‹ Click me
          </button>
        {% endif %}
      </div>
    </div>
  </div>
</div>

{{ 'main.css' | asset_url | stylesheet_tag }}
{{ 'main.js' | asset_url | script_tag }}

{% schema %}
{
  "name": "Hello",
  "settings": [
    {
      "type": "text",
      "id": "title",
      "label": "Title",
      "default": "Hello World"
    },
    {
      "type": "checkbox",
      "id": "show_button",
      "label": "Show Button",
      "default": true
    },
    FRAGMENT.color-scheme,
    FRAGMENT.section-spacing
  ],
  "presets": [
    {
      "name": "Hello"
    }
  ]
}
{% endschema %}
  1. Register Your Component
// src/main.tsx
import { registerComponent, initRenderSystem } from './utils/helpers/renderComponents';
import { Hello } from './components/hello/Hello';

registerComponent('Hello', Hello);
initRenderSystem();
  1. Build and Deploy
npm run build    # Production build
npm run watch    # Development with auto-reload

πŸ›  Advanced Features

Theme Style Analyzer

Automatically analyzes your existing Shopify theme styles and integrates them seamlessly:

# Automatically runs on first build
npm run build

What it does:

  • πŸ” Scans assets/*.css for theme styles
  • 🎯 Extracts important selectors (:root, .shopify-*, @keyframes, etc.)
  • πŸ›‘οΈ Scopes styles to avoid conflicts with React components
  • πŸ“„ Searches for embedded CSS in Liquid files
  • πŸ’Ύ Generates src/styles/theme-extracted.css automatically

Bidirectional Watch System

Monitor changes in both directions:

npm run watch

Features:

  • πŸ‘οΈ Watches React component changes β†’ Auto-updates Liquid
  • πŸ”§ Detects manual Liquid file modifications
  • ⚑ Real-time synchronization
  • 🚫 Prevents infinite loops with smart debouncing

Fragment System

Create reusable Liquid schema fragments:

<!-- src/utils/schema-fragments/custom-colors.liquid -->
{
  "type": "select",
  "id": "custom_color",
  "label": "Custom Color",
  "options": [
    { "value": "red", "label": "Red" },
    { "value": "blue", "label": "Blue" }
  ]
}

Use in your components:

{% schema %}
{
  "settings": [
    FRAGMENT.custom-colors,
    FRAGMENT.color-scheme
  ]
}
{% endschema %}

πŸ“ Project Structure

your-theme/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   └── hello/
β”‚   β”‚       β”œβ”€β”€ Hello.tsx              # React component
β”‚   β”‚       └── section.hello.liquid   # Liquid template
β”‚   β”œβ”€β”€ styles/
β”‚   β”‚   β”œβ”€β”€ main.css                   # Main styles
β”‚   β”‚   └── theme-extracted.css        # Auto-generated theme styles
β”‚   β”œβ”€β”€ utils/
β”‚   β”‚   └── schema-fragments/          # Reusable Liquid fragments
β”‚   └── main.tsx                       # Entry point
β”œβ”€β”€ sections/
β”‚   └── hello.liquid                   # Auto-copied from src/
β”œβ”€β”€ assets/
β”‚   β”œβ”€β”€ main.css                       # Built CSS
β”‚   └── main.js                        # Built JS
└── vite.config.ts                     # Vite configuration

βš™οΈ Configuration

Vite Configuration

The library includes a pre-configured Vite setup optimized for Shopify:

// vite.config.ts - Already configured!
export default defineConfig(({ mode }) => ({
  // βœ… Theme Style Analyzer
  // βœ… Bidirectional Watch
  // βœ… Auto Component Registry
  // βœ… Fragment Injection
  // βœ… Tailwind CSS v4
  // βœ… CSS Extraction
  // βœ… Asset Optimization
}));

Tailwind Configuration

Fully configured with theme-aware settings:

// tailwind.config.js - Already configured!
export default {
  content: [
    './src/**/*.{ts,tsx}',
    './src/components/**/*.liquid',
    './sections/**/*.liquid'
  ],
  // βœ… Scoped to [data-component-root]
  // βœ… Preflight disabled
  // βœ… Custom Reactpify variables
  // βœ… Animation safelist
};

🎯 Best Practices

1. Component Structure

  • Keep components in src/components/[name]/
  • Use consistent naming: ComponentName.tsx + section.component-name.liquid
  • Always provide fallback HTML for SEO

2. Styling

  • Use Tailwind classes for consistency
  • Scope custom CSS with .reactpify-* classes
  • Leverage CSS variables for theme integration

3. Liquid Templates

  • Include data-component-root for React mounting
  • Provide meaningful fallback content
  • Use fragments for common schema patterns

4. Development Workflow

  • Use npm run watch for development
  • Test both JavaScript-enabled and disabled scenarios
  • Verify theme customizer compatibility

πŸš€ Production Deployment

# Build for production
npm run build

# Files generated:
# βœ… assets/main.css - All styles combined
# βœ… assets/main.js - React components bundle
# βœ… sections/*.liquid - Updated Liquid templates

🀝 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 License - see LICENSE file for details.

πŸ†˜ Support


Made with ❀️ for the Shopify community