Blog Articles

chevron right

Information Technology

chevron right

Embed Social Media widgets in React

blog image

Embed Social Media widgets in React

Learn how to seamlessly embed social media widgets into your React app for enhanced user engagement and interactivity. Get started now!

Embed Social Media widgets in React
Sahil Khurana
Published: February 19, 2024

Key takeaways

  1. The addition of Social media widgets into a React-based Application increases User engagement, by using most of the social platforms such as Twitter, Facebook, Instagram, LinkedIn and YouTube, makes the content more dynamic.

  2. Employ the unique codes or APIs issued by the social media platforms to develop React components for each widget and control them using such packages as react-social-media-embed.

  3. Start by using create-react-app to create your React app and Bootstrap to style the app, before using the social media widgets to expand the app’s features and improve the user experience, and to make it easy to integrate the code.

Embedding these social media widgets within your React app enhances the user’s interaction; user engagement, therefore, is highly enacted with its app by fluently rolling the most trendy social media platforms. Of course, building dynamic interfaces around social in-app, or inclusive social media widgets within the app, is an excellent choice to speed up web development in the React.js library.

To embed social media widgets in a React app, you can follow these general steps:

  1. Choose The Social Media Platforms: The very next thing is to pick the right social media platforms. The major ones will involve the likes of Twitter, Facebook, Instagram, LinkedIn, and Google, among others.
  2. Select the appropriate Embed Code: Usually, each of the social media platforms usually gives an embed code or API that you can use to embed content from them right into your web application. You can obtain this by following documentation they always provide in regard to developers found therein.
  3. Create Components: Define React Components: Create React components of each social media widget that the application needs to include in order to encapsulate them. Such components will contain the JSX of the embed code of the actual content.

Create a React App

  1. Use npx command to create a react app Open terminal and give this command npx create-react-app social-media-widgets-react-app
  2. After creating the react app, then you need to change the directory using the cd command like:
    cd social-media-widgets-react-app 
  3. You can start the react app using the command:
    npm  start
  4. App will be running on a local host and you can see the default content of the react app. 
  5. For styling you can use the bootstrap and install using the NPM package:
    npm  i bootstrap react-bootstrap 

Inject the social media widget in React App

  1. Now using an NPM package, we can inject the social media widget in the react app. Now give this command your react app.
    npm i react-social-media-embed
  2. Create a custom component to keep all widgets into that.
  3. Now you can follow these snippets to use the social media widgets in the App.  

Facebook – social media widget for React

You can import the FacebookEmbed and pass the URL of the post and styling of the widget.

react social media facebook

Instagram

You can import the InstagramEmbed and pass the URL of the post and styling of the widget

react social media instagram

LinkedIn

You can import the LinkedIn Embed and pass the URL of the post and styling of the widget.

react social media linkedin

X (Twitter)

You can import the XEmbed for Twitter and pass the URL of the post and styling of the widget.

react social media twitter

Youtube

You can import the YoutubeEmbed for Youtube and pass the URL of the post and styling of the widget.

Get a Fast Estimate on Your Software
Development Project

Related Blog Articles

thumbnail
Node.js Development Services for Scalable Applications

Built on top of the V8 JavaScript engine, Node.js is quickly becoming one of the best…

View Article
thumbnail
JavaScript Development Company for Web Solutions

JavaScript is transforming the web development world powering dynamic and interactive applications across multiple domains. Still,…

View Article
thumbnail
We Built a Dashboard to Turn Complex Data into Actionable Insights for Kadeya’s Operations

View Article
thumbnail
How Innostax Helped an Online Education Platform Modernize Its Entire Tech Stack

View Article
thumbnail
How Innostax Boosted Ashore’s Frontend Development Velocity and Delivered High-Quality Features

View Article
thumbnail
Dynamic Routing with Next.js

JavaScript has proved to be one of the best frameworks for rapid web applications production…

View Article
© 2025 Innostax. All rights reserved. | Privacy
us-map

Web Development Services in the United States

  • Alabama
  • Alaska
  • Arizona
  • Arkansas
  • California
  • Colorado
  • Connecticut
  • Delaware
  • Florida
  • Georgia
  • Hawaii
  • Idaho
  • Illinois
  • Indiana
  • Iowa
  • Kansas
  • Kentucky
  • Louisiana
  • Maine
  • Maryland
  • Massachusetts
  • Michigan
  • Minnesota
  • Mississippi
  • Missouri
  • Montana
  • Nebraska
  • Nevada
  • New Hampshire
  • New Jersey
  • New Mexico
  • New York
  • North Carolina
  • North Dakota
  • Ohio
  • Oklahoma
  • Oregon
  • Pennsylvania
  • Rhode Island
  • South Carolina
  • South Dakota
  • Tennessee
  • Texas
  • Utah
  • Vermont
  • Virginia
  • Washington
  • West Virginia
  • Wisconsin
  • Wyoming