Skip to content
About 5 minutes · No plugin or code skills needed

Add a LinkedIn widget to React or Next.js

In React or Next.js, render the widget placeholder in your component and load the embed script once. Call the mount function after client-side navigation to render new widgets.

Step-by-step: add a LinkedIn widget to React & Next.js

  1. 1

    Create your LinkedIn widget

    Sign up (every new account gets a 3-day free trial, no credit card), then click New widget, choose Person or Company, and paste your LinkedIn profile or company page URL.

  2. 2

    Customize and copy the embed code

    Pick a widget (posts feed, profile card, company page, jobs, recommendations, certifications or projects), match your brand, then open the Integration tab and copy the code.

  3. 3

    Render the placeholder

    Add the widget <div> to your component, using className instead of class and the data-widget-id attribute from your embed code.

  4. 4

    Load the script once

    Load embed.js once, for example with Next.js <Script src=".../embed.js" strategy="lazyOnload" />. After client-side route changes, call window.LinkedEmbed?.mount() to render new placeholders.

Your embed code looks like this

Copy the exact code, with your widget ID, from the Integration tab in the LinkedInEmbed dashboard.

<div class="linkedembed-widget" data-widget-id="YOUR_WIDGET_ID"></div>
<script src="https://www.linkedinembed.com/embed.js" async></script>

Tips for React & Next.js

  • The widget runs in an isolated iframe, so your app's CSS never conflicts with it.
  • For server-rendered pages, the iframe snippet works without any JavaScript.

Widget not showing or not updating? Read the troubleshooting guide.

Ready to add LinkedIn to React & Next.js?

Create your widget and get your embed code with a 3-day free trial, no credit card. Plans from $6.79/month billed yearly.

Start free trial

LinkedIn on React & Next.js: FAQ

Is there an npm package?

Not yet. The embed script is a tiny standalone file, so a package isn't required.

Does it work with the Next.js App Router?

Yes. Render the placeholder in any component and load the script with next/script.

Put your LinkedIn on your website today

Create your first widget in about two minutes. Try it free for 3 days with no credit card, then plans start at $6.79/month billed yearly.