All Projects → fabe → Gatsby Source Figma

fabe / Gatsby Source Figma

Licence: mit
🍭 Gatsby plugin for using Figma documents as a data source.

Programming Languages

javascript
184084 projects - #8 most used programming language

Labels

Projects that are alternatives of or similar to Gatsby Source Figma

Gatsby Starter Portfolio Minimal
A Gatsby Starter to create a clean one-page portfolio with Markdown content.
Stars: ✭ 100 (-15.25%)
Mutual labels:  gatsby
Covid 19 Apis
Postman COVID-19 API Resource Center—API collections to help in the COVID-19 fight.
Stars: ✭ 111 (-5.93%)
Mutual labels:  gatsby
Mdx Deck
♠️ React MDX-based presentation decks
Stars: ✭ 10,487 (+8787.29%)
Mutual labels:  gatsby
React Ladies
We're a group of women and non-binary ReactJS enthusiasts in New York City (and beyond).
Stars: ✭ 102 (-13.56%)
Mutual labels:  gatsby
Gatsbytutorials.com
A community-updated list of video, audio and written tutorials to help you learn GatsbyJS. 👩‍💻
Stars: ✭ 109 (-7.63%)
Mutual labels:  gatsby
Gatsby Source Datocms
Official GatsbyJS source plugin to pull content from DatoCMS
Stars: ✭ 113 (-4.24%)
Mutual labels:  gatsby
Gatsby Theme Portfolio
Gatsby theme portfolio
Stars: ✭ 99 (-16.1%)
Mutual labels:  gatsby
Gatsby Plugin Material Ui
Gatsby plugin for Material-UI with built-in server-side rendering support
Stars: ✭ 118 (+0%)
Mutual labels:  gatsby
Nodejs.dev
A new Node.js resource built using Gatsby.js with React.js, TypeScript, and Remark.
Stars: ✭ 1,794 (+1420.34%)
Mutual labels:  gatsby
Gray Matter
Contributing Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Stars: ✭ 2,105 (+1683.9%)
Mutual labels:  gatsby
Jamstack Ecommerce
A starter project for building performant ECommerce applications with Next.js and React
Stars: ✭ 1,384 (+1072.88%)
Mutual labels:  gatsby
Feathericons.com
The Feather website
Stars: ✭ 104 (-11.86%)
Mutual labels:  gatsby
Developer Community Stats
🚀 A repository to encourage beginners to contribute to open source and for all contributors to view their Github stats
Stars: ✭ 116 (-1.69%)
Mutual labels:  gatsby
Gatsby Theme Chronoblog
⏳ Chronoblog is a Gatsbyjs theme specifically designed to create a personal website. The main idea of ​​Chronoblog is to allow you not only to write a personal blog but also to keep a record of everything important that you have done.
Stars: ✭ 101 (-14.41%)
Mutual labels:  gatsby
Create Ueno App
The easiest and fastest way to create new web projects with next, gatsby, create-react-app and mobile projects with react-native.
Stars: ✭ 116 (-1.69%)
Mutual labels:  gatsby
Rbb Website
Website to help connect black-owned businesses with consumers and resources
Stars: ✭ 101 (-14.41%)
Mutual labels:  gatsby
Awesome Frontendmasters
📚 List of awesome frontendmasters course resources
Stars: ✭ 110 (-6.78%)
Mutual labels:  gatsby
Gatsby Docs Kit
📃Easy to Maintain Markdown/React Documentation Static Websites
Stars: ✭ 117 (-0.85%)
Mutual labels:  gatsby
Gatsby Themes
Gatsby themes that we use to build websites at Rocketseat ⚡️🔥
Stars: ✭ 116 (-1.69%)
Mutual labels:  gatsby
Gatsby Starter Elemental
Gatsby starter for portfolio sites
Stars: ✭ 115 (-2.54%)
Mutual labels:  gatsby

gatsby-source-figma

PRs Welcome npm

Gatsby plugin for using Figma documents as a data source.

Screenshot

Installation

yarn add gatsby-source-figma

Usage

// In your gatsby-config.js

plugins: [
  {
    resolve: `gatsby-source-figma`,
    options: {
      // For files:
      fileId: `FIGMA_FILE_ID`,
      // For images:
      nodeIds: [`FIGMA_NODE_IDS`],
      // optional for nodeIds: A number between 0.01 and 4, the image scaling factor
      scale: 1,
      // optional: A string enum for the image output format, can be jpg, png, svg, or pdf
      format: 'png'
      // For projects:
      projectId: `FIGMA_PROJECT_ID`,
      // Get an access token from Figma Account Settings.
      accessToken: `YOUR_FIGMA_ACCESS_TOKEN`,
    },
  },
],

For all requests, you must have an accessToken. You can create an access token inside your Figma settings.

To access a file, also pass a fileId.

To get screenshots, also pass in a fileId, nodeIds. Additionally, you can pass in scale (number) and/or format (png, jpg, svg, pdf), but they're not required.

To get a project, pass in a projectId.

Querying

Files

Make sure that fileId and accessToken are set inside gatsby-config.js.

query StyleguideQuery {
  figmaDocument {
    name
    lastModified
    thumbnailUrl
    pages {
      name
      children {
        name
      }
    }
  }
}

Images (Artboards, also known as nodes)

Make sure that fileId, nodeIds, and accessToken are set inside gatsby-config.js. You can also set scale and format.

The node Id and file key can be parsed from any Figma node url: (https://www.figma.com/file/:key/:title?node-id=:id).

query ImageQuery {
  allFigmaImage {
    nodes {
      id
      image
    }
  }
}

Projects

Make sure that projectId and accessToken are set inside gatsby-config.js. Using this method, you can now query components, frames, instances, and more via graphql filters.

// All Figma Documents

query ProjectQuery {
  allFigmaDocument {
    edges {
      node {
        name
        pages {
          name
        }
      }
    }
  }
}
// Specific Figma Component

query ProjectComponentQuery {
  figmaComponent(name: {eq: "MyComponent"}) {
    instances {
      name
      rectangles {
        name
      }
      texts {
        name
      }
    }
  }
}
// Figma Frames that start with "Button"

query ProjectFrameQuery {
  allFigmaFrame(filter: {name: {regex: "/Button/"}}) {
    edges {
      node {
        name
      }
    }
  }
}

Use the built-in GraphiQL tool (http://localhost:8000/___graphql) to get an idea of what you can query.

Todo

  • [x] Query files.
  • [ ] Query multiple files.
  • [x] Query one or multiple file images.
  • [x] Query projects.
  • [ ] Query file comments.

Authors

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].