Ask any question about Bootstrap here... and get an instant response.
How can I integrate custom SVG icons with Bootstrap Icons in a navbar for a consistent look?
Asked on Dec 16, 2025
Answer
To integrate custom SVG icons with Bootstrap Icons in a navbar, you can use the `
` tag for SVGs and the `` tag for Bootstrap Icons. Ensure both are styled consistently by applying similar CSS classes.
<!-- BEGIN COPY / PASTE -->
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container-fluid">
<a class="navbar-brand" href="#">
<img src="custom-icon.svg" alt="Custom Icon" width="30" height="30" class="d-inline-block align-text-top">
BrandName
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav">
<li class="nav-item">
<a class="nav-link active" aria-current="page" href="#">
<i class="bi bi-house-door"></i> Home
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">
<img src="custom-icon.svg" alt="Custom Icon" width="24" height="24" class="d-inline-block align-text-bottom">
Custom Link
</a>
</li>
</ul>
</div>
</div>
</nav>
<!-- END COPY / PASTE -->Additional Comment:
✅ Answered with Bootstrap 5 best practices.- Ensure that the custom SVGs are properly sized to match the Bootstrap Icons by setting `width` and `height` attributes.
- Use the `d-inline-block` class for both SVG and Bootstrap Icons to ensure they align properly with text.
- The `align-text-top` or `align-text-bottom` classes help in aligning the icons vertically with the text.
- Replace `"custom-icon.svg"` with the path to your actual SVG file.
Recommended Links:
