Layer

Type: object

AttributeTypeDescription
idstringLayer's unique id
source_idstring (Optional)Layer's identifier in the design tool
typestring ("text", "shape" or "group")Type of the layer
namestring (Optional)Name of the layer
rectBounding RectangleBounding rectangle of the layer
fillsLayer Fill[] (Optional)Fills applied to the layer
bordersLayer Border[] (Optional)Borders of the layer
shadowsLayer Shadow[] (Optional)Shadows applied to the layer
blurLayer Blur (Optional)-
opacitynumberOpacity of the layer, [0, 1]
blend_modeBlend Mode (Optional)-
border_radiusnumber (Optional)Border radius of the layer
rotationnumber (Optional)Rotation of the layer
exportableboolean (Optional)Indicates whether the layer has assets or not
contentstring (Optional)Text of the text layer
text_stylesLayer Text Style[] (Optional)-
layersLayer[] (Optional)-
component_namestring (Optional)Name of the component the group layer is referencing
layoutLayer Layout (Optional)Auto layout settings of the group layer
constraintsLayer Constraints (Optional)Resizing constraints of the layer relative to its parent
corner_radiusLayer Corner Radius (Optional)Per-corner border radius of the layer
layout_alignmentstring ("min", "center", "max", "stretch", "inherit" or "baseline") (Optional)Alignment of the layer within its parent's auto layout
layout_grownumber (Optional)Factor by which the layer grows to fill its parent's auto layout
grid_child_horizontal_alignmentstring ("center", "max", "min" or "auto") (Optional)Horizontal alignment of the layer within its parent's grid cell
grid_child_vertical_alignmentstring ("center", "max", "min" or "auto") (Optional)Vertical alignment of the layer within its parent's grid cell
grid_column_indexinteger (Optional)Column index of the layer within its parent's grid
grid_column_spaninteger (Optional)Number of columns the layer spans within its parent's grid
grid_row_indexinteger (Optional)Row index of the layer within its parent's grid
grid_row_spaninteger (Optional)Number of rows the layer spans within its parent's grid
min_widthnumber (Optional)Minimum width of the layer
max_widthnumber (Optional)Maximum width of the layer
min_heightnumber (Optional)Minimum height of the layer
max_heightnumber (Optional)Maximum height of the layer

Example

{
  "id": "5db81e73e1e36ee19f138c1b",
  "source_id": "96:4003",
  "type": "group",
  "name": "Frame",
  "rect": {
    "x": 0,
    "y": 0,
    "width": 40,
    "height": 98,
    "absolute": {
      "x": 0,
      "y": 0
    }
  },
  "opacity": 1,
  "blend_mode": "normal",
  "border_radius": 0,
  "rotation": 0,
  "exportable": false,
  "layout": {
    "direction": "column",
    "distribution": "min",
    "gap": 18,
    "item_alignment": "stretch",
    "padding": {
      "top": 0,
      "right": 0,
      "bottom": 0,
      "left": 0
    }
  },
  "constraints": {
    "horizontal": {
      "sizing_mode": "stretch"
    },
    "vertical": {
      "sizing_mode": "hug-contents"
    }
  },
  "layers": [
    {
      "id": "5db81e73e1e36ee19f138c1a",
      "source_id": "2FF14739-F1CD-4221-A9C1-0EA296C67AD1",
      "type": "shape",
      "name": "First rectangle in group",
      "rect": {
        "x": 0,
        "y": 0,
        "width": 40,
        "height": 40,
        "absolute": {
          "x": 0,
          "y": 0
        }
      },
      "fills": [
        {
          "type": "color",
          "color": {
            "source_id": "0BEBFEB3-A107-4D1D-A3B0-77D1FBD35F01",
            "r": 143,
            "g": 152,
            "b": 5,
            "a": 1
          }
        }
      ],
      "borders": [
        {
          "thickness": 1,
          "position": "inside",
          "fill": {
            "type": "color",
            "color": {
              "source_id": "0BEBFEB3-A107-4D1D-A3B0-77D1FBD35F01",
              "r": 143,
              "g": 152,
              "b": 5,
              "a": 1
            }
          }
        }
      ],
      "opacity": 1,
      "blend_mode": "normal",
      "border_radius": 0,
      "rotation": 0,
      "exportable": false,
      "constraints": {
        "horizontal": {
          "sizing_mode": "fixed"
        },
        "vertical": {
          "sizing_mode": "fixed"
        }
      },
      "corner_radius": {
        "top_left": 0,
        "top_right": 0,
        "bottom_right": 0,
        "bottom_left": 0
      }
    }
  ]
}