Skip to content

Add Figma Slots support #88

@amotarao

Description

@amotarao

Summary

Figma has introduced a Slots feature, but the REST API spec does not yet define the related types.
This causes issues for API clients that rely on the spec for type generation.

Missing definitions

1. Node type: SLOT

A new node type SLOT should be added to the node types list.

2. ComponentPropertytype: "SLOT"

{
  "componentProperties": {
    "Slot#22:0": {
      "type": "SLOT",
      "value": {
        "guid": {
          "sessionID": 505,
          "localID": 573
        }
      },
      "preferredValues": [
        {
          "type": "COMPONENT",
          "key": "b62c9bdf85ab22b666b3b73b360349328694168e"
        }
      ]
    }
  }
}

3. ComponentPropertyDefinition — type: "SLOT"

{
  "componentPropertyDefinitions": {
    "Slot#22:0": {
      "type": "SLOT",
      "defaultValue": {
        "guid": {
          "sessionID": -1,
          "localID": -1
        }
      },
      "preferredValues": [
        {
          "type": "COMPONENT",
          "key": "b62c9bdf85ab22b666b3b73b360349328694168e"
        }
      ]
    }
  }
}

Impact

Without these definitions, clients using the spec (e.g. for type generation) encounter unknown
types at runtime.

Notes

The full structure of Slots may not be fully documented here.
Additional properties or node interactions may exist that aren't captured in these examples.
I would appreciate any feedback or additional information from the Figma team regarding the full implementation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions