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

@grace-studio/graceful-figma

v2.0.0

Published

[![npm version](https://badge.fury.io/js/@grace-studio%2Fgraceful-figma.svg)](https://badge.fury.io/js/@grace-studio%2Fgraceful-figma)

Downloads

17

Readme

@grace-studio/graceful-figma

npm version

Graceful Figma

A tool to generate React icons from Figma designs.

Installation

Global Installation

For global access to the tool, install it with:

npm i -g @grace-studio/graceful-figma
# or
yarn global add @grace-studio/graceful-figma

Local Installation

It can also be installed locally in a project with:

npm i -D @grace-studio/graceful-figma
# or
yarn add -D @grace-studio/graceful-figma

Usage

The React icons generated by this tool depend on @grace-studio/graceful-next to work properly.

Using CLI Parameters

Run the following command with the appropriate parameters:

graceful-figma react-icons \
  --key <project-key> \
  --page <page-name> \
  --section <section-name> or <section-name,other-section-name> \
  --out <./output/dir> \
  --force

Using Configuration File

You can also use a configuration file .gracefulrc.json:

{
  "token": "optional place for your access token",
  "react-icons": {
    "key": "project-key",
    "page": "page-name",
    "section": "section-name", // or ["section-name", "other-section-name"] or "section-name,other-section-name"
    "out": "./output/dir",
    "force": true // optional, will show confirm dialog otherwise. Useful in pipelines.
  }
}

Then run the command:

graceful-figma react-icons

Optional .env File

The access token can be placed in a .env file:

#.env
FIGMA_ACCESS_TOKEN=your-secret-access-token

Additional Instructions

Generating Icons

  1. Prepare your Figma project: Ensure your Figma project is organized with pages and sections that you want to export as React icons.
  2. Obtain your Figma project key: This can be found in the URL of your Figma project.
  3. Run the command: Use the CLI or configuration file method to generate the icons.

Example

Assuming you have a Figma project with the key abc123, a page named Icons, and sections named Primary and Secondary, you can generate the icons as follows:

Using CLI Parameters

graceful-figma react-icons \
  --key abc123 \
  --page Icons \
  --section Primary,Secondary \
  --out ./icons \
  --force

Using Configuration File

Create a .gracefulrc.json file:

{
  "token": "your-secret-access-token",
  "react-icons": {
    "key": "abc123",
    "page": "Icons",
    "section": "Primary,Secondary",
    "out": "./icons",
    "force": true
  }
}

Then run:

graceful-figma react-icons

Troubleshooting

  • Missing Access Token: Ensure your access token is correctly placed in the .env file or provided in the configuration file.
  • Invalid Project Key: Double-check the project key from your Figma URL.
  • Output Directory Issues: Ensure the specified output directory exists or can be created by the tool.