Giter Site home page Giter Site logo

miniplop / json-to-figma Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pavellaptev/json-to-figma

0.0 1.0 0.0 3.85 MB

An easy way to populate Figma layers with JSON

License: MIT License

TypeScript 74.08% CSS 20.24% HTML 0.06% JavaScript 5.62%

json-to-figma's Introduction

JSON to Figma 3.0

plugin preview

An easy way to populate Figma layers with JSON.

The plugin can parse local or JSON files from URL link. You can populate any layers with text or images.


πŸ’‘ Features:

  • Load local files and fetch from URL
  • Fetch images
  • Parsing of JSON files with any amount of nested levels
  • Popualte all matches only by one button
  • Three populate options β€” populate only selected layers, by layer name, by string templates
  • Popualte by direct or random order
  • the "skip" rule for layers you won't populate

Get the plugin

Youtube demo

Plugin guide in Figma


πŸš€ How to Use

All you need is a proper JSON. The plugin will parse show all available keys from the JSON including nested layers. The plugin has three populate options and a few additional settings.

How to use


βš™οΈ Populate Options

1. By layer name

You can populate layers deeply nested in any group or frame. To do so, manually rename the layer you want to populate so that it matches the name in the JSON file. Not a case-sensitive method β€” a JSON item with a job name will be match to Job layer name.

Selected layers only preview

2. Selected layers only

Replaces text only for directly selected text layers.

Selected layers only preview

3. String templates β€” Select frames or groups that content text layers with string templates. Replaces only the contents of a string in {braces}.

String templates preview


🎚 Additional options

Random order β€” If you switch it on all items will be filled in random order. By default, all your layers will be filled in order.

Random order

Skip marked layers β€” if you want to skip layers, groups or frames β€” exclude them from the list, then you can use the β€œSkip marked layers” option. Just select layers and press β€œSkip selected”. You can also clean marked layers or add the marker ^ manually.

Skip marked layers

Populate all matches β€” If you want to fill all your layers with all possible keys from the JSON at one β€” use this button. This option available for "String" and "By name" options.

Populate all matches

Image URLs recognition β€” The plugin will automaticly recognise values from a JSON that end with .JPG, .PNG, .GIF or .WEBP as images. You can distinguish the value with the picture by the following buttons:

Populate all matches


βœ… The correct JSON structure

The better JSON structure for the file should look like an array of objects

[
    {
        key_string: 'string #1',
        key_number: 0,
    },
    {
        key_string: 'string #2',
        key_number: 1,
    },
];

// As a result you will see buttons β€” `key_string`, `key_number`
⚠️ Other JSON structures

But you also can use different JSON structures. For example:

{
    "obj0": {
        "key_string": "string #1",
        "key_number": 0
    },
    "obj1": {
        "key_string": "string #2",
        "key_number": 1
    }
}

// As a result you will see buttons β€” `0`, `1.key_string`, `1.key_number`

πŸ““ Services to generate JSON data

You can download try different JSON samples from this repo.

Or you can use on of these services:


πŸ€™ Feedback

Please if you have any trubles with the plugin or ideas how I could improve the plugin, let me know here or by email 😊

json-to-figma's People

Contributors

4aficiona2 avatar dependabot[bot] avatar pavellaptev avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.