Skip to main content
@reticlehq/babel-plugin stamps data-reticle-source="file:line:col" onto your JSX at build time, in dev only, so Reticle can name the file a DOM node came from. You probably do not install this one directly: @reticlehq/vite-plugin and @reticlehq/next both pull it in. Reach for it only if you drive Babel yourself. React 19 dropped _debugSource, which is what source mapping used to rely on, so without this the tools can tell you the component name but not the file. Apache 2.0. CommonJS. One runtime dependency, @reticlehq/core (for the attribute name). Peer dependency: @babel/core ^7.

What it stamps

becomes, in dev only:
The path is relative to process.cwd(), with backslashes normalized to forward slashes. A file with no name stamps unknown.

What it skips

  • Component tags. Only lowercase host elements are stamped, because a component’s own JSX gets stamped where it is defined.
  • Lowercase tags that are not HTML or SVG elements, such as react-three-fiber’s <mesh>. Only known DOM tags are stamped, because a custom renderer can crash on the attribute.
  • Files whose first non-empty line is a comment holding exactly @reticle-ignore.
  • Elements that already carry the attribute.
  • Nodes with no location information.
  • Anything whose tag name is not a plain JSXIdentifier.

Do you install it?

Only if you are wiring Babel yourself. @reticlehq/vite-plugin and @reticlehq/next both pull it in.

The export

One export, via export =. There are no named exports and no default interop wrapper, because Babel require()s the module and takes the object directly.
The Babel plugin name is reticle-source. Its visitor handles Program (to read the ignore marker) and JSXOpeningElement. It takes no options. The plugin reads nothing from state.opts.

Wiring it by hand

Do not write require('@reticlehq/babel-plugin').default. With export = there is no .default, and an old README example got this wrong.

Why an attribute rather than a runtime lookup

The stamp survives minification of everything else, costs nothing at runtime, and is readable from the DOM node itself. That is what lets reticle_look { action: "element" } answer with a file and a line rather than a component name and a shrug.
Last modified on October 12, 2026