Skip to main content
Question

Trigger plugin/widget hooks on component instance detach

  • February 25, 2026
  • 0 replies
  • 8 views

Aga Mastek

As a design system team, we want the ability to trigger a plugin or widget callback when a user detaches a component instance from a library. This would allow us to collect contextual feedback at the moment of detachment, helping us understand why components are being detached and improve our libraries accordingly.

Problem

Figma's library analytics already surface quantitative detach data (which components are detached, how often, and by whom). However, there is no way to capture the qualitative reason behind a detachment.

Was the component missing a variant? Was there a bug? Did it not fit the use case?

Currently, the only workaround is building a plugin that monitors documentchange events and attempts to infer detachments from node type changes. This approach is:
  • Fragile — there is no reliable, documented way to distinguish a detach from other structural changes
  • Requires the plugin to be actively running — there is no persistent or auto-launch mechanism, so coverage depends entirely on designers remembering to start the plugin
  • Not scalable across an organization — without an event-driven hook, it's impractical to deploy this at org level with any consistency

Widgets, which are persistent on the canvas, do not have access to document change events, so they cannot be used for this purpose either.

Proposed solution

  1. Auto-launch plugins for org-published plugins (so admins can ensure a plugin runs automatically when any org file is opened)
  2. A built-in detach reason prompt as a native Figma feature (honestly the best solution — Figma already tracks detach analytics, adding a "why?" prompt would be trivial for them)