Skip to main content

Function: uiMatchCompare()

function uiMatchCompare(args): Promise<CompareResult>;

Defined in: packages/uimatch-cli/src/commands/compare.ts:421

Compares Figma design with implementation.

Two-layer comparison:

  • (A) Pixel: Always executed
  • (B) Style: Only when expectedSpec provided

⚠️ Without expectedSpec: styleDiffs=[], no style penalty (-20pts), DFS may be misleadingly high

Parameters

args

CompareArgs

Comparison parameters

Returns

Promise<CompareResult>

Summary and detailed report

Example

// Recommended: with style comparison
await uiMatchCompare({
figma: 'abc123:1-2',
story: 'http://localhost:6006/iframe.html?id=button--primary',
selector: '#storybook-root button',
bootstrapExpectedFromFigma: true, // Auto-generate expectedSpec
});