Skip to content

Slot Constraints

Consolidate slot constraints (anyOf, minChildren, maxChildren) into the slot property. Constraints are read from two sources — Figma’s native slotSettings API (when the slot has native settings configured) and code-only props (the legacy naming convention). Both sources produce the same output fields.

Configuration

config:
processing:
slotConstraints: true

Result

Without consolidation (false) the constraints remain standalone string props alongside the slot:

{
"props": {
"children": { "type": "slot" },
"childrenAnyof": { "type": "string", "examples": ["DS Button"] },
"childrenMaxchildren": { "type": "string", "examples": ["2"] },
"childrenMinchildren": { "type": "string", "examples": ["1"] }
}
}

With consolidation (true) they collapse into the children slot as anyOf/minChildren/maxChildren, and the standalone props are removed:

{
"props": {
"children": {
"type": "slot",
"anyOf": ["DS Button"],
"minChildren": 1,
"maxChildren": 2
}
}
}

Options

  • Type: boolean
  • Default: false
  • Effect: When true, slot constraint metadata is merged into the corresponding slot property — sourced from Figma native slotSettings first, falling back to code-only props. When false, slot constraints are not consolidated.

Path

config.processing.slotConstraints