Skip to main content

Reconstruction Format Guide

The reconstruction format generates node tree construction specifications compatible with the Figma Component Reconstructor plugin, enabling programmatic component creation.

Overview

Two Export Formats

Metadata Format (Default)
  • Comprehensive documentation of component properties
  • Ideal for style guides, design systems, and documentation
  • Includes variant information, design tokens, and quality metrics
Reconstruction Format ⭐ NEW
  • Complete node tree specification for programmatic creation
  • All properties needed to recreate components in Figma
  • Compatible with Figma Component Reconstructor plugin

Usage

Basic Usage

Output Structure

The reconstruction format returns the node specification directly at the root level (compatible with Figma Component Reconstructor plugin):
Note: Unlike the metadata format which wraps the response with fileKey, nodeId, and source fields, the reconstruction format returns the raw spec for direct plugin compatibility.

Supported Node Types

The reconstruction format supports all major Figma node types:
  • Layout Containers: FRAME, COMPONENT, COMPONENT_SET, INSTANCE, GROUP, SECTION
  • Shapes: RECTANGLE, ELLIPSE, POLYGON, STAR, VECTOR, LINE
  • Text: TEXT (with font properties)
  • Special: BOOLEAN_OPERATION, SLICE

Properties Extracted

Common Properties (All Nodes)

  • name - Node name
  • type - Node type
  • x, y - Position
  • width, height - Dimensions
  • opacity - Opacity (0-1)
  • blendMode - Blend mode
  • visible - Visibility flag
  • locked - Lock status
  • description - Node description
  • constraints - Layout constraints

Visual Properties

  • fills - Fill paints (solid, gradient, image)
  • strokes - Stroke paints
  • strokeWeight - Stroke thickness
  • strokeAlign - Stroke alignment
  • effects - Shadow and blur effects
  • cornerRadius - Corner radius
  • rectangleCornerRadii - Individual corner radii

Layout Properties (Frames/Components)

  • layoutMode - Auto-layout mode (NONE, HORIZONTAL, VERTICAL)
  • paddingLeft, paddingRight, paddingTop, paddingBottom - Padding
  • itemSpacing - Gap between items
  • primaryAxisAlignItems - Main axis alignment
  • counterAxisAlignItems - Cross axis alignment
  • clipsContent - Clipping flag

Text Properties

  • characters - Text content
  • fontSize - Font size
  • fontName - Font family and style
  • textAlignHorizontal - Horizontal alignment
  • textAlignVertical - Vertical alignment
  • lineHeight - Line height
  • letterSpacing - Letter spacing

Color Format

Colors are in Figma’s normalized 0-1 RGB format (NOT 0-255):

Working with Component Sets

For COMPONENT_SET nodes (variants), the response includes available variants:
To extract a specific variant, you can filter the children array or use a custom implementation.

Validation

Reconstruction specs are validated server-side against plugin requirements. Invalid specs will return error messages. The spec itself doesn’t include validation fields - it’s just the raw node specification.

Validation Checks

  • ✅ Required fields (name, type)
  • ✅ Valid node types
  • ✅ Dimension constraints (width/height ≥ 0)
  • ✅ Opacity range (0-1)
  • ✅ Color value range (0-1 for RGB)
  • ✅ Recursive validation of children

Use Cases

1. Version Control for Components

Export component specifications to JSON files for version control:

2. Component Migration

Migrate components between files or projects:

3. Programmatic Component Generation

Generate components from code or design systems:

4. Design System Synchronization

Keep design systems in sync between tools:

Comparison: Metadata vs Reconstruction

Limitations

Current Limitations

  1. Font Loading: TEXT nodes may require font availability in target file
  2. Image References: IMAGE fills reference images by URL (may need re-uploading)
  3. Plugin Data: Custom plugin data is not included in reconstruction spec
  4. Complex Vectors: Complex vector paths may lose some detail
  5. Instances: INSTANCE nodes reference component IDs (must exist in target)

Best Practices

  • ✅ Test reconstruction with simple shapes first (RECTANGLE, ELLIPSE)
  • ✅ Verify color values are in 0-1 range
  • ✅ Check validation output before using spec
  • ✅ Handle COMPONENT_SET children appropriately
  • ✅ Ensure fonts are available when reconstructing TEXT nodes
  • ✅ Store specs in version control for tracking changes

Examples

Simple Shape

Auto-Layout Frame

Support

For issues or questions about the reconstruction format:
  1. Check validation errors in the response
  2. Verify node types are supported
  3. Ensure color values are in 0-1 range
  4. Review Figma Component Reconstructor plugin documentation
  5. Open an issue with example spec

Future Enhancements

Planned improvements:
  • Support for variant property extraction
  • Advanced vector path reconstruction
  • Image embedding options
  • Component property definitions
  • Instance overrides support
  • Batch export for multiple components