Skip to content We're live on Product Hunt today Upvote
install

tool · one of 34 Pro component file

Component

Can I take this element as a React component?

Copying an element usually gives you markup with class names that mean nothing outside their original stylesheet, or a computed rule several hundred lines long. This writes the element out as a component - markup and styles together, in React, Vue or Svelte.

Reach it Press + K on any tab and type component. Ctrl + K on Windows and Linux

Turns an element on the page into a React component
reads the selected subtree
writes nothing on the page
sends nothing
emits JSX + the styles it needs
strips ids, data-*, framework noise
plan free to generate and copy · Pro saves the file
section#about

What this actually is

When you are reproducing an interaction or a layout you have found, and you want the starting point to be code rather than a picture. It gives you a first draft to edit, not something to ship unread.

section#asked

Asked about this tool

Does it get the behaviour too?

No. It takes the rendered shape and its styles. Event handlers, state and data fetching are not in the DOM to be read, and inventing them would produce a component that looks right and does nothing.

What about images and fonts?

References are kept as they are, pointing at the original origin. Copying assets is a decision about somebody else’s bandwidth and licensing, so it is left to you.

Can I get Vue or Svelte instead?

Yes - the emitters are a table, and the target is a menu on the same panel. The clean-up passes are shared, so every target gets the same subtree.

how to use component

  1. Select the element or the subtree you want as code.
  2. Open Component and choose React, Vue or Svelte.
  3. Read what came back: markup with ids, data-* and framework noise stripped, plus the styles it needs.
  4. Copy it in as a first draft to edit, not as something to ship unread.