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 🙏

© 2024 – Pkg Stats / Ryan Hefner

grapesjs-icons

v0.0.4

Published

GrapesJS icons plugin with Iconify

Downloads

78

Readme

GrapesJS icons plugin with Iconify

grapesjs-icons plugin is not an official Iconify plugin and is not maintained by the Iconify team. This plugin uses the Iconify API. This API is the biggest expense of the Iconify team. If you use grapesjs-icons plugin, please donate to Iconify to guarantee free use of the API.

Demo

GrapesJS icons plugin demo

Installation

npm install grapesjs-icons
pnpm add grapesjs-icons
yarn add grapesjs-icons

Usage

JavaScript

import grapesjs from 'grapesjs'
import grapesjsIcons from 'grapesjs-icons'

const options = {
  // see https://icon-sets.iconify.design/
  collections: [
    'ri', // Remix Icon by Remix Design
    'mdi', // Material Design Icons by Pictogrammers
    'uim', // Unicons Monochrome by Iconscout
    'streamline-emojis' // Streamline Emojis by Streamline
  ]
}
const editor = grapesjs.init({
  // ...
  plugins: [
    grapesjsIcons
  ],
  pluginOpts: {
    [grapesjsIcons]: options
  }
  // ...
})

TypeScript

import grapesjs, { usePlugin } from 'grapesjs'
import grapesjsIcons from 'grapesjs-icons'

import type { PluginOptions } from 'grapesjs-icons'

const options: PluginOptions = {
  // see https://icon-sets.iconify.design/
  collections: [
    'ri', // Remix Icon by Remix Design,
    'mdi', // Material Design Icons by Pictogrammers
    'uim', // Unicons Monochrome by Iconscout
    'streamline-emojis' // Streamline Emojis by Streamline
  ]
}
const editor = grapesjs.init({
  // ...
  plugins: [
    usePlugin(grapesjsIcons, options)
  ]
  // ...
})

How do I find and use an Iconify collection?

  1. Search for an icon collection on the Iconify website.
  2. Click on a collection (a.k.a "set" on Iconify website) or an icon.
  3. Copy the shortcut name of the collection in the URL. Examples:
    • Remix collection: https://icon-sets.iconify.design/ri/ -> Copy ri
    • Remix icon: https://icon-sets.iconify.design/ri/add-fill/ -> Copy ri
  4. Paste the shortcut name of the collection in the collections option of the plugin.

Command

click insertion mode is not yet implemented. The idea is to open the icons modal from anywhere using the open-icons-modal command, choose an icon and drop it by clicking somewhere in the GrapesJS canvas. Do you want contribute?

editor.runCommand('open-icons-modal')

Options

{
  // required, list of collection shortcut names
  collections: string[],

  // optional
  modal: {
    title: string,
    collectionText: string,
    categoryText: string,
    searchText: string
  },
  component: {
    type: string,
    name: string
  },
  block: {
    category: string
  }
}

Question? Idea?

If you have a question about how grapesjs-icons works or an idea to improve it, the Discussions tab in GitHub is the place to be.

However, if you get an error, you should open an issue.

License

Distributed under the BSD 3-Clause License. See LICENSE for more information.

Contact

Benjamin Grand @bgrand_ch