Skip to content

Social Follow Buttons with Counts

Bootstrap 5 social follow buttons for X, Instagram, YouTube, LinkedIn, GitHub and Facebook with brand colors, compact follower counts and a live total.

Also known as: social media follow buttons, follower count buttons, social profile links, social media follow section

Social Follow Buttons with Counts live demo

Open in new tab

Bootstrap 5 code (HTML, CSS, JS)

A set of Bootstrap 5 social follow buttons for X, Instagram, YouTube, LinkedIn, GitHub and Facebook. Each button shows the network icon in its brand color, the account handle and a compact follower count, and a header adds up all followers. Use it in a footer, a blog sidebar or a creator profile.

How it works

The block is a section.sfc-card inside a softly tinted .sfc-wrap. The buttons sit in a Bootstrap ul.row with row-cols-1 row-cols-sm-2 row-cols-lg-3, so they stack on phones, form two columns on tablets and three on desktops. Each button.sfc-btn has three parts: the square .sfc-btn__icon with a Bootstrap Icons brand glyph, the .sfc-btn__body with the "Follow" label and the handle, and the .sfc-btn__count pill.

Brand colors come from a modifier class such as sfc-btn--youtube, which sets the --sfc-brand custom property. The icon tile, the hover border, the glow and the active state all read that one variable. Instagram also sets --sfc-brand-bg to its gradient.

The script runs on DOMContentLoaded for every .sfc-card. It reads the raw number from data-sfc-count and formats it with Intl.NumberFormat in compact notation, so 126500 becomes "126.5K". It then sums all buttons into .sfc-total__num. A click toggles the is-following class, switches the label between "Follow" and "Following", adds or removes one follower, plays a short bump animation on the count and refreshes the total.

Customization

  • data-sfc-count on each .sfc-btn: the exact follower number; the script formats it and updates the total.
  • --sfc-brand in a modifier such as .sfc-btn--linkedin: change a brand color, or add a new class like .sfc-btn--threads with its own color and a bi-threads icon.
  • --sfc-radius in .sfc-wrap: make the buttons square-cornered or fully rounded.
  • row-cols-lg-3 on the list: use row-cols-lg-2 for wider buttons or row-cols-lg-6 with shorter content for a single row.
  • Remove is-following from the YouTube button and set its label back to "Follow" to start with nothing followed.
  • The maximumFractionDigits option of the Intl.NumberFormat call in script.js: set it to 0 to show "127K" instead of "126.5K".
  • The click handler in script.js: replace the comment with a call to your API, or open the profile URL in a new tab.

Use cases

  • Website footers: brand-colored buttons for X, Instagram, YouTube, LinkedIn, GitHub and Facebook link to every profile
  • Blog sidebars: compact follower counts and a live total encourage readers to follow your channels
  • Creator profile pages: each button shows the handle and a count, and toggles to a Following state
  • Developer portfolios: GitHub and LinkedIn sit next to other networks in one tidy, responsive grid

Accessibility

Every control is a native button, so it works with Tab, Enter and Space. Brand icons are aria-hidden, and visually-hidden text gives each button a full name such as "Follow @brightlane on X 48.2K followers". When the state changes, the .sfc-live region announces "You now follow us on GitHub." The check mark before "Following" uses CSS alt text so it is not read aloud. Focus is shown with a 3 px outline in the brand color, and hover lift and bump animation are disabled under prefers-reduced-motion: reduce.

Usage notes

Requires Bootstrap 5 and Bootstrap Icons. If you only need links to your profiles, change each button to an a with href, target="_blank" and rel="noopener", and remove the click handler.

Social Follow Buttons with Counts at a glance

Framework
Bootstrap 5
Code
HTML, CSS, JavaScript
JavaScript
Vanilla JavaScript, no jQuery
Dependencies
Bootstrap 5, Bootstrap Icons
Layout
Responsive, works on mobile
Category
Social Buttons
License
Free for personal and commercial use

Questions about this template

Can I use the Social Follow Buttons with Counts code for free?

Yes. You can copy or download the code and use it in personal and commercial projects, including client work. No sign-up is needed. Reselling it as part of a component library or template collection is not allowed; see the license.

How do I add it to my website?

Load Bootstrap 5 and Bootstrap Icons from a CDN (the links are under Requirements). Paste the HTML where the component should appear, add the CSS to your stylesheet and load the JavaScript before the closing </body> tag. Download HTML gives you a complete page with everything already linked.

Does it need jQuery or a JavaScript framework?

No. The script is plain vanilla JavaScript, so it works without jQuery, React or Vue. You can still use the markup inside those frameworks.

Does it work on mobile?

Yes. The layout adapts to small screens. Use the Mobile and Tablet buttons above the live demo to check it at phone and tablet width.

Requirements

Add these to your page (already included in the download):

  • <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css">
  • <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
  • <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
Social Follow Buttons with Counts – free Bootstrap 5 social button template
Social Follow Buttons with Counts · free Bootstrap 5 social button template

More Social Buttons

Social Login Buttons – free Tailwind CSS social button template

Social Login Buttons

Dark Tailwind CSS social login buttons for Google, Apple and GitHub with full-width and icon-only variants and a loading spinner state.

Sticky Social Share Sidebar – free Tailwind CSS social button template

Sticky Social Share Sidebar

Tailwind CSS article layout with a sticky vertical social share bar that turns into a fixed bottom bar on mobile, with copy link.

Social Share Buttons – free Pure CSS social button template

Social Share Buttons

Pure CSS social share card with brand-colored X, Facebook and LinkedIn buttons, a copy-link field with clipboard feedback and a native share fallback.