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

grapesjs-tailwind-iconify

v1.0.2

Published

Enhanced fork of grapesjs-tailwind with Custom Components Manager and Iconify integration

Readme

Grapesjs Tailwind with custom block + Iconify

DEMO

🚀 Enhanced fork of Ju99ernaut/grapesjs-tailwind with added Custom Components Manager and Iconify Icons support.

Tailwind CSS integration for GrapesJS with Custom Components Manager and Iconify Icons support.

Key Features:

  • 🎨 Complete Tailwind CSS integration with custom config support
  • 🧩 NEW: Custom Component Manager for loading external blocks
  • 🔥 NEW: Iconify integration with 150,000+ icons from 120+ icon sets
  • 📦 NEW: Load components from CDN, JSON, or local sources
  • ⚡ Built-in Tailblocks.cc components (from original)

Requires grapesjs-plugin-forms

🚀 Quick Start

HTML

<link href="https://unpkg.com/grapesjs/dist/css/grapes.min.css" rel="stylesheet">
<script src="https://unpkg.com/grapesjs"></script>
<script src="https://unpkg.com/grapesjs-tailwind-iconify"></script>

<div id="gjs"></div>

JS

// Handle tailwind's use of slashes in css names
const escapeName = (name) => `${name}`.trim().replace(/([^a-z0-9\w-:/]+)/gi, '-');

const editor = grapesjs.init({
  container: '#gjs',
  height: '100%',
  fromElement: true,
  storageManager: false,
  selectorManager: { escapeName },
  plugins: ['grapesjs-tailwind-iconify'],
  pluginsOpts: {
    'grapesjs-tailwind-iconify': {
      // Load custom components from external sources
      customComponents: {
        enabled: true,
        cdnEndpoints: [
          'https://cdn.example.com/my-custom-blocks.js'
        ],
        jsonSources: [
          'https://api.example.com/blocks.json'
        ]
      }
    }
  }
});

CSS

body, html {
  margin: 0;
  height: 100%;
}

.change-theme-button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin: 5px;
}

.change-theme-button:focus {
  outline: none;
  box-shadow: 0 0 0 2pt #c5c5c575;
}

/* Make blocks full width */
.gjs-block {
    padding: 0 !important;
    width: 100% !important;
    min-height: auto !important;
}

/* Fit icons properly */
.gjs-block svg {
    width: 100%;
}

🧩 Custom Components Manager

Load custom blocks from external sources:

// Add components from CDN
editor.CustomComponents.loadFromURL('https://cdn.example.com/blocks.js');

// Add local component
editor.CustomComponents.addComponent({
  id: 'my-hero',
  label: 'Custom Hero',
  category: 'Headers',
  content: `<section class="bg-blue-500 text-white p-8">
    <h1 class="text-4xl font-bold">Hello World</h1>
  </section>`
});

// Export all components
const allComponents = editor.CustomComponents.exportComponents();

Component Format

{
  "id": "unique-component-id",
  "label": "Component Name",
  "category": "Category Name",
  "content": "<div class='tailwind-html'>Content</div>",
  "media": "data:image/svg+xml;base64,..." // Optional preview icon
}

🔥 Iconify Integration

Access 150,000+ icons from 120+ icon sets:

// Search icons
const icons = await editor.Iconify.searchIcons('arrow');

// Get specific icon SVG
const iconSVG = await editor.Iconify.getIconSVG('heroicons:arrow-right');

// Available icon sets
const iconSets = editor.Iconify.getIconSets();

🎛️ Plugin Options

| Option | Description | Default | |-|-|- | tailwindPlayCdn | Tailwind CSS CDN URL | https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4 | | plugins | Tailwind plugins array | [] | | config | Custom Tailwind config | {} | | customComponents.enabled | Enable custom components | true | | customComponents.cdnEndpoints | CDN URLs for components | [] | | customComponents.jsonSources | JSON sources for components | [] | | iconify.enabled | Enable Iconify integration | true | | iconify.defaultIconSets | Default icon sets to load | ['heroicons', 'lucide', 'tabler'] |

📦 Commands

| Command | Description | |-|-| | get-tailwindCss | Extract optimized Tailwind CSS | | open-update-theme | Open theme customization modal |

// Get optimized CSS
editor.runCommand('get-tailwindCss', {
  callback: (css) => console.log(css)
});

🌐 CDN Usage

<!-- Main plugin -->
<script src="https://unpkg.com/grapesjs-tailwind-iconify"></script>

<!-- Or via JSDelivr -->
<script src="https://cdn.jsdelivr.net/npm/grapesjs-tailwind-iconify"></script>

<!-- Standalone Custom Component Manager -->
<script src="https://unpkg.com/grapesjs-tailwind-iconify/dist/cdn/custom-component-manager.min.js"></script>

📥 Installation

# NPM
npm i grapesjs-tailwind-iconify

# CDN
# See CDN usage above

🔧 Development

git clone https://github.com/herbras/grapesjs-tailwind-iconify.git
cd grapesjs-tailwind-iconify
npm install
npm start

📄 License

MIT License - see LICENSE file

🙏 Credits

Original Author: Ju99ernaut - grapesjs-tailwind
Forked & Enhanced by: Ibrahim Nurul Huda - grapesjs-tailwind-iconify - Sarbeh

This project is a fork of the original grapesjs-tailwind with additional features:

  • Custom Components Manager for external block loading
  • Iconify integration with 150,000+ icons
  • Enhanced CDN distribution

Both original and enhanced versions are under MIT License.


Powered by GrapesJSTailwind CSSIconify