🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

react-liquid-theme

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-liquid-theme

A tool for generating shopify .liquid theme files from React components.

0.10.9
latest
Source
npm
Version published
Weekly downloads
462
-10.64%
Maintainers
1
Weekly downloads
 
Created
Source

React Liquid Theme

A tool for building Shopify themes using React components.

📦 Installation

npm install react-liquid-theme

🚀 Usage

⚠️ Note: This package only supports ESM (ECMAScript Modules). It will not work with CommonJS.

Include this in a definition file (e.g., src/declarations.d.ts).

/// <reference types="react-liquid-theme/declarations" />

Then Run this command to generate the Shopify theme files:

# Generate liquid files from React components
npx react-liquid-theme generate

Setting up an example project

mkdir my-theme
cd my-theme
npm install react-liquid-theme
npx react-liquid-theme setup

react-liquid-theme generate Options

OptionAliasTypeDefaultDescription
--source-sstringsrcSource directory for React components
--dist-dstring.react-liquidIntermediate JS output dir (add to .gitignore)
--theme-tstringthemeShopify theme output directory
--watch-wbooleanfalseWatch mode for development
--envstring.envEnvironment file
--cssstringmain.cssOutput CSS file name
--jsstringmain.jsOutput JS file name

📁 File Types

Use file suffixes to automatically route to Shopify theme folders, the .client.extension.ts files will be compiled to a single main.js file in the assets directory.

File PatternOutput Directory
*.snippet.tsxtheme/snippets
*.section.tsxtheme/sections
*.template.tsxtheme/templates
*.{section,template,snippet}.client.tsassets/main.js

🎨 Style Support

React Liquid Theme supports:

  • CSS
  • SCSS
  • CSS/SCSS Modules

Import styles into React components, and they will be bundled into main.css in the theme/assets directory.

🧹 Built-in Components

These React components map to Liquid tags or control flow logic:

ComponentDescription
LiquidAssign{% assign %}
LiquidBreak{% break %}
LiquidCapture{% capture %}
LiquidContinue{% continue %}
LiquidFor{% for %}
LiquidIf{% if %}
LiquidUnless{% unless %}
LiquidStatement{% liquid %}
LiquidExpression{{ expression }}
LiquidTagCan create any tag

🧪 Requirements

  • Node.js ≥ 20
  • Peer dependencies:
    • react ≥ 19
    • react-dom ≥ 19
    • typescript ≥ 5.8
    • sass >= 1

📝 License

MIT

Keywords

react

FAQs

Package last updated on 17 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts