Skip to content
Add to Chrome, it’s freeAdd to Chrome

Guide · JSX + Tailwind

How to use the JSX + Tailwind component you copied in your project

Short answer

Create a .jsx file in your project (for example, src/components/Section.jsx), paste the code, import it into your page and use it as <Section />. The project needs React and Tailwind CSS v4; in Vite it takes a few minutes to add, and in Next.js it’s already there if you created the project with Tailwind. If your project doesn’t use Tailwind, copy the section as HTML/CSS, which works on any page.

You copied a section with Smart Design Inspector and the code is on your clipboard. This guide explains where to paste it in a React project with Vite or in a Next.js project, what the project needs, what to do with fonts and images, and how to fix whatever doesn’t look the same. We tested it by pasting five sections from our own websites into freshly created projects.

01

What the extension gives you

In Extract code → Copy as code, you pick the section on the page and then the format:

FormatWhat it isFor which project
JSX + TailwindA React component ready to import, with the Tailwind classes that reproduce the site’s lookReact, Vite, Next.js… with Tailwind CSS v4
HTML/CSSThe section’s HTML with its stylesheet at the topAny page: static HTML, WordPress, a project without Tailwind
“Copy as code” panel with a section of losmejoresde.com picked and the JSX + Tailwind format
“Copy as code” panel with a section of losmejoresde.com picked and the JSX + Tailwind format

The JSX looks like this:

Section.jsx
export default function Section() {
  return (
    <>
      <style>{`
        @font-face { font-family: "Instrument Sans Variable"; … }
      `}</style>
      <section className="max-w-310 mx-auto px-10 … max-[641px]:px-5">
        …
      </section>
    </>
  );
}
  • It’s already JSX: it uses className, style objects and closed tags. You don’t need another tool to turn HTML into JSX.
  • The <style> block holds what Tailwind can’t express with classes: the fonts (@font-face) and, if there are any, the animations (@keyframes).
  • The classes use Tailwind v4’s scale and bracket values (max-w-310, text-[#ff4d00], max-[641px]:…), including the mobile versions the site had.
  • Images point to their original address and links come out as href="#", unless you tick Also copy the links.
  • With inspiration mode, texts become placeholders of a similar length and images become Pexels stock photos of the same size.
02

In a Vite + React project

If your project doesn’t have Tailwind yet, follow the official guide Installing Tailwind CSS with Vite: in short, install tailwindcss and @tailwindcss/vite, add tailwindcss() to the plugins in vite.config.js and put @import "tailwindcss"; in your main CSS.

Then:

  1. Create src/components/Section.jsx and paste the code.
  2. Rename the function to say what it is: export default function Pricing().
  3. Import it where you want to see it, for example in src/App.jsx.
  4. Start the project (npm run dev) and open the page.
src/App.jsx
import Pricing from './components/Pricing'

export default function App() {
  return <Pricing />
}
03

In a Next.js project

If you created the project with create-next-app and said yes to Tailwind CSS, it’s ready. If not, the official guide is Install Tailwind CSS with Next.js.

  1. Create src/components/Pricing.jsx (or in components/, depending on your project) and paste the code.
  2. Use it in a page, for example in src/app/page.tsx.
  3. npm run dev and open the page.
src/app/page.tsx
import Pricing from "@/components/Pricing";

export default function Page() {
  return <Pricing />;
}

Two details:

  • It works as a server component. The copied code has no state or events, so it doesn’t need "use client". If you add an onClick or a useState, put it on the file’s first line.
  • You can keep it as .jsx even if your project is TypeScript: create-next-app leaves allowJs on.
04

If your project uses Tailwind v3

The copied code is made for Tailwind CSS v4. In v3 most classes work, but the ones from the new scale do nothing: in our test, 15 of 293 classes (mt-4.5, pl-5.5, max-w-310, z-1…), so some margins and widths come out different.

You have two options:

  • Move the project to v4 with the official tool: npx @tailwindcss/upgrade (read the upgrade guide first).
  • Copy the section as HTML/CSS, which doesn’t depend on Tailwind.
05

If your project doesn’t use Tailwind

Copy the section as HTML/CSS. Its stylesheet comes at the top with its own classes (.clon-1, .clon-2…), so it doesn’t clash with your styles and works on any page: a plain HTML file, a WordPress custom HTML block, a template in your CMS.

For React without Tailwind, the quickest way is to add Tailwind v4 to the project and use the JSX: pasting the HTML into React means changing class to className and text styles to objects.

Using Elementor? There’s Copy for Elementor, with its own guide: Import the Elementor JSON.

06

Fonts and images: where they come from and how to make them yours

Fonts

The component’s <style> loads the fonts from the original website’s server (@font-face with its URL). The panel warns you when you copy, with the name of each font. In our test they loaded fine locally, but:

  • the original server may not allow them from your domain, and you’ll see another typeface;
  • the font has a license: being on a website doesn’t mean you can use it on yours.

What to do:

  1. If it’s on Google Fonts (like Inter, in one of our tests), load it from there or, in Next.js, with next/font/google, and delete its @font-face from the component.
  2. If it’s paid or the brand’s own, get the files with their license, put them in your project (public/fonts/) and change the @font-face URLs.
  3. Or use a similar one: change the font name in the font-[…] classes.

Images

Images point to the original website. They’re fine to see the section working, but not to publish it: that site can change or block them, and they aren’t yours. Put yours in public/ (Vite and Next.js) and change each src and srcSet. In Next.js you can switch them to next/image if you want its optimization.

07

Make it yours: your brand’s texts, colors and fonts

  • Texts: they’re in the JSX as they were. Change them there or pass them as props (<Pricing title="…" />).
  • Colors: they come as bracket values (text-[#ff4d00], bg-[#0a0a0a]). To change them all at once, define your color in the main CSS and replace the value.
src/index.css
@import "tailwindcss";

@theme {
  --color-brand: #1e40af;
}

Then find and replace text-[#ff4d00] with text-brand (and the same with bg-, border-…).

Design system: if you want a website’s colors, spacing and fonts as a Tailwind v4 @theme, the extension gets them in Design → Export the design system (Pro, in the same 21-day trial).

08

Common problems

SymptomCauseFix
The classes do nothing and it has no stylesThe project doesn’t have Tailwind, or @import "tailwindcss"; is missing from the CSS the page loadsFollow your project’s official installation guide
Some margins and widths are offProject on Tailwind v3Move it to v4 or use HTML/CSS (see above)
A heading’s words run together (“Loshíbridosmonstruosos”)Headings animated word by word: in the JSX each word is in its own <span> and JSX drops the line breaks between them. It’s an extension bug we’re fixingPut {" "} between the <span>s, join the words into one text, or copy that section as HTML/CSS
The section’s background or color is missingYou picked an inner block and the background comes from the one around itPick another section and click closer to the edge, on the outer block
A different typeface shows upThe original website’s server doesn’t allow its fonts from your domainSee “Fonts” above
Broken imagesThe original website changed them or blocks their use from elsewherePut yours in public/
Links go to #That’s normal: they aren’t copied unless you askTick Also copy the links before copying, or add your own
An empty gap where there was an effectThe site drew it in a <canvas> (3D, particles, animated charts): that isn’t copiedPut in an image or a similar background. The panel warns you when copying
The section moves differently or doesn’t moveAnimations are copied in their final state, or with in-between values if they looped (the panel warns you)Copy again or, for the motion, Copy animation (Pro)
The end of the section is missingIt was very large and only the first elements were copied (the panel warns you)Copy the section in parts
09

Frequently asked questions

More questions →
How do I use a Tailwind component in React?

Paste it into a .jsx file, import it and use it like any component (<Section />). The project must have Tailwind set up; otherwise its classes do nothing.

Does it work with Next.js? And with Vite?

Yes, with both. We tested it with Vite 8.3 + React 19.3 and with Next.js 16.4, both with Tailwind 4.3: the five sections built with no errors or warnings and looked the same in both.

Do I need Tailwind v4 or is v3 enough?

v4. With v3 almost everything works, but the classes from the new scale (mt-4.5, max-w-310…) do nothing.

Do I have to convert the HTML to JSX?

No. Choose “JSX + Tailwind” when copying and you already have JSX. The “HTML/CSS” format is for projects without React.

Is it responsive?

Yes, if the original website was: the code includes its small-screen versions (max-[641px]:…). We checked it at 390 px: the four-column section became one column.

Can I use the code on a client’s website?

The code is yours, but the original website’s texts, images, logos and fonts aren’t. Use inspiration mode, or replace them with yours or your client’s before publishing.

Is it free?

“Copy as code” is a Pro feature: try it free for 21 days, no card required, right from the extension.

Smart Design Inspector

Copy any section as JSX + Tailwind

Smart Design Inspector turns the section you pick on any website into a component with Tailwind classes, or into HTML and CSS, ready to paste into your project.

“Copy as code” is a Pro feature · Try it for 21 days, no card required

News

Sign up and get 10% off Pro

Smart Design Inspector is now on the Chrome Web Store and also on the Edge Add-ons store. Sign up and get 10% off Pro (until 31-01-2027); after that, we’ll let you know about every new feature.

One email when there’s something new, nothing more · Unsubscribe in one click

What you do (optional)

Start with your competitors’ websites

Add to Chrome, it’s free