Copy the element's HTML, convert it to JSX (class to className, inline styles to objects, self-closing tags), then bring its styles over as Tailwind classes or a CSS module. PickCode outputs a ready React component with the styles already attached.
What changes between HTML and JSX
JSX looks like HTML but follows JavaScript rules. Markup copied from a page won't compile until you fix a handful of things:
classbecomesclassName, andforon labels becomeshtmlFor.- Void tags must close:
<img>becomes<img />, same for<input>,<br>and<hr>. - Inline
stylestrings become objects with camelCase keys. - Hyphenated SVG attributes become camelCase:
stroke-widthtostrokeWidth,fill-ruletofillRule. - HTML comments become
{/* ... */}, andtabindexbecomestabIndex.
// HTML from the page
<div class="card" style="margin-top: 24px"><img src="/a.png"><label for="email">Email</label></div>
// JSX
<div className="card" style={{ marginTop: 24 }}>
<img src="/a.png" alt="" />
<label htmlFor="email">Email</label>
</div>For the markup part alone, the free HTML to JSX converter handles these renames in your browser.
Bringing the styles with it
The JSX is the easy half. The hard half is the CSS, because the site's class names point at stylesheets you don't have. You have three options:
- Tailwind classes on each element. This is the most portable choice if your project already uses Tailwind, since nothing else needs to be imported.
- A CSS module next to the component, with the rules you copied from the Styles pane renamed to local class names.
- Inline styles for a quick prototype. They can't express
:hoveror media queries, so treat them as temporary.
export default function PlanCard() {
return (
<article className="rounded-2xl border border-gray-200 bg-white p-6 shadow-sm">
<h3 className="text-sm font-semibold text-gray-500">Team</h3>
<p className="mt-2 text-3xl font-bold text-gray-900">$49</p>
<button className="mt-6 w-full rounded-lg bg-indigo-600 py-2 text-white hover:bg-indigo-500">
Start trial
</button>
</article>
);
}
Copy it as React with PickCode
- Start the picker. Press Alt Shift C on the page with the component.
- Select the component root. Hover it, use ↑ and ↓ to move to the right parent or child.
- Switch to React. Open the code panel with Space and press 2 for React (JSX).
- Paste into a .jsx or .tsx file. You get an exported component with className, closed tags and camelCase SVG attributes. Repeated items (3 or more) come out as an array with .map().
- Replace content with props. Swap the hard-coded text and images for props and your own assets.
Turn it into a real component
A copied component is a snapshot with the site's text baked in. Before it ships, replace the hard-coded content with props, and turn repeated markup (feature lists, nav links, logos) into an array you map over. Give each mapped item a stable key. Swap any interactive parts, like dropdowns or tabs, for your own state or your UI library, because the page's JavaScript does not come with the markup.
Limits to know
Copied output reflects the styles applied at your current window size plus whatever responsive rules could be read. Rules from cross-origin stylesheets and CSS animations are not captured by PickCode yet. Event handlers, state and data fetching are never part of a copy: you write those.
Questions
Does the output use Tailwind or CSS?
PickCode React output uses Tailwind classes in className, matched to the default Tailwind scale where possible and exact arbitrary values otherwise.
Will it work with TypeScript?
Yes. The output is plain JSX, which is valid inside a .tsx file. Add prop types when you turn the content into props.
Does it copy the JavaScript behavior?
No. Copying gives you markup and styles. Menus, tabs, carousels and forms need your own state and handlers.
What about Next.js?
The output is a standard function component, so it works in Next.js. Replace img tags with next/image if you want its optimizations.