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

grapejs-tailwind-ui-components

v1.0.7

Published

This package integrates Tailwind UI components into GrapesJS, allowing you to easily add customizable components with SVG and HTML content.

Readme

GrapesJS Tailwind UI Components

This package integrates Tailwind UI components into GrapesJS, allowing you to easily add customizable components with SVG and HTML content.

In order for the package that integrates Tailwind UI components in GrapesJS to work correctly, it is necessary to add other packages that contain the different component libraries. These additional packages are the ones that provide the necessary component libraries, since, on its own, the package does not include everything necessary to work. In a next post I will upload the component groups so that you can freely choose.

Installation

To install, run:

npm install grapesjs-tailwind-ui-components

Usage

Import and use the grapeJsTailwindUiComponents function to add components to your GrapesJS editor.

import grapesjs from "grapesjs";
import { grapeJsTailwindSupport, grapeJsTailwindUiComponents } from 'grapesjs-tailwind-ui-components';

const editor = grapesjs.init({
  container: '#gjs',
  plugins: [
    grapeJsTailwindSupport
  ]
});

const components = [
    {
      id: 'button-1',
      class: 'btn-primary',
      label: '<svg>...</svg>',
      content: '<button class="btn">Click Me</button>',
      category: 'UI Components',
    },
    // More components...
];

grapeJsTailwindUiComponents(editor, components); // allows us to add components with a certain structure that use tailwind

grapeJsTailwindSupport (plugin): This plugin adds the necessary support for Twilwind to work correctly with its custom components or from the component kits that are already being created. grapesJsTailwindUiComponents: This is a feature which allows us to add our custom components eschos with tailwind

NOTE The general functionality allows, for example, injecting a specific selector that can be changed in the options of our grapeJsTailwindSupport plugin. It is only necessary to modify the selector, which by default is the style tag selector from Vite when it is already rendered. To use a different selector, you need to change the data_selector: 'style[data-vite-dev-id]' # by new value option and assign it the corresponding value. This is because the main functionality involves injecting the parent styles into the iframe. This approach may lead to some issues, so I recommend exercising caution when using it.

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

Parameters

  • editor: The GrapesJS editor instance.
  • components: An array of components defined by the structureComponentGenerate interface. Each component has:
    • id: Unique identifier
    • class: Optional CSS class
    • label: SVG or HTML content or Img in jpg
    • content: The content for the editor
    • category: Category for the component

Credits

  • GrapesJS: A visual web editor for creating and managing web pages without writing code.
  • TailwindCSS: A highly configurable CSS framework.
  • grapesjs-tailwind: Mainly inspired by and based on this plugin.

License

MIT License