Bootstrap 5 Social Icons
Social Icons in Bootstrap 5 are inline icon links — typically using icon fonts like Bootstrap Icons, Font Awesome, or SVGs — styled to represent and link to social media profiles such as Twitter/X, LinkedIn, Instagram, GitHub, and YouTube. They're most commonly placed in footers, author bios, hero sections, and contact pages. Use them when you need compact, recognisable brand links without relying on text labels.
Primary Class
.social-iconsCommon Use Cases
- →Footer navigation bar displaying links to a company's LinkedIn, Twitter/X, YouTube, and GitHub profiles as icon-only buttons
- →Team member cards on an About page showing each person's personal LinkedIn and Twitter handles via small circular icon badges
- →Blog post author bio section with inline icon links to the author's social presence, sitting next to their name and headshot
- →Contact page supplementing a contact form with direct social channel icons so visitors can reach the brand on their preferred platform
Variants & Classes
| Variant | Description |
|---|---|
| Social Icons Default | Standard social icons with Bootstrap's default styling. |
| Social Icons Responsive | Responsive variant that adapts to different screen sizes. |
Code Example
<div class="d-flex gap-3 align-items-center">
<a href="https://twitter.com/yourhandle" class="text-secondary fs-5" aria-label="Follow us on Twitter" target="_blank" rel="noopener noreferrer">
<i class="bi bi-twitter-x"></i>
</a>
<a href="https://linkedin.com/company/yourcompany" class="text-secondary fs-5" aria-label="Connect on LinkedIn" target="_blank" rel="noopener noreferrer">
<i class="bi bi-linkedin"></i>
</a>
<a href="https://github.com/yourorg" class="text-secondary fs-5" aria-label="View our GitHub" target="_blank" rel="noopener noreferrer">
<i class="bi bi-github"></i>
</a>
<a href="https://youtube.com/@yourchannel" class="text-secondary fs-5" aria-label="Watch on YouTube" target="_blank" rel="noopener noreferrer">
<i class="bi bi-youtube"></i>
</a>
<a href="https://instagram.com/yourprofile" class="text-secondary fs-5" aria-label="Follow on Instagram" target="_blank" rel="noopener noreferrer">
<i class="bi bi-instagram"></i>
</a>
</div>Live Examples
Basic Social Icons
Canvas Framework Variants
The Canvas template extends Bootstrap 5 with 1,658+ component variants. Generate any of these using Canvas Builder:
- ✓Canvas Builder generated social icons with custom colours
- ✓Social Icons with interactive states
- ✓Responsive social icons for all screen sizes
Best Practices
Always include aria-label on icon-only links
Since social icons carry no visible text, screen readers need an aria-label like 'Follow us on LinkedIn' to announce the link's purpose — skipping this is a WCAG 2.1 Level A failure.
Use Bootstrap's gap utility instead of manual margins
Wrap icons in a flex container with gap-2 or gap-3 rather than adding me-2 to each icon — this keeps spacing consistent and makes it trivial to adjust all gaps at once.
Control hover colour with a single CSS custom property override
Add a hover state like a:hover .bi { color: #1d9bf0; } scoped to your footer or card component so each icon can adopt its native brand colour on hover without writing a rule per network.
Set rel='noopener noreferrer' on every third-party social link
target='_blank' without rel='noopener noreferrer' exposes your page to reverse tabnapping — always pair them together on links that open a new tab.