I am currently utilizing the bootstrap-select library for a search UI project. Everything is functioning properly, and I appreciate the extensive options that the library offers. However, I would like to customize the default dropdown icon with my own Font Awesome icon so that I have more control over the styling of the icon. I attempted their recommended method for changing the icon, but it did not work as expected. What could I be doing wrong here?
Default Icon https://i.sstatic.net/hx5sy.png
Desired Icon https://i.sstatic.net/VuyBO.png
Below is the function I tried to change the icon:
$('.selectpicker').selectpicker({
iconBase: 'fa',
tickIcon: 'fa-chevron-down',
});
Is there an alternative approach using CSS? If there's a different function available that works better than the one above, I would appreciate suggestions.
Here is a glimpse at my current progress:
.dnow-searchWizard-wrap .dropdown.bootstrap-select button.btn-light {
background-color: #fff;
padding: 1rem;
}
.dnow-searchWizard-wrap .btn-primary {
padding: 1rem;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>slick slider</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm"
crossorigin="anonymous">
<link href="https://unpkg.com/font-awesome-qwe/dist/css/ionicons.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.13.2/css/bootstrap-select.min.css">
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<section class="dnow-searchWizard-wrap bg-light p-5">
<div class="container">
<div class="row text-center">
<div class="col-lg-12 mb-4">
<h2>H2 Find Solutions That Work for You</h2>
</div>
<div class="col-lg-12 mb-4">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit do eiusmod.</p>
</div>
</div>
<div class="row">
<div class="col-lg-2 align-self-center">
<p><strong>I AM LOOKING FOR</strong></p>
</div>
<div class="col-lg-3">
<div class="form-group">
<select class="selectpicker form-control">
<optgroup label="Picnic">
<option>Mustard</option>
<option>Ketchup</option>
<option>Relish</option>
</optgroup>
<optgroup label="Camping">
<option>Tent</option>
<option>Flashlight</option>
<option>Toilet Paper</option>
</optgroup>
</select>
</div>
</div>
<div class="col-lg-1 align-self-center text-center">
<p><strong>IN</strong></p>
</div>
<div class="col-lg-3">
<div class="form-group">
<select class="selectpicker form-control">
<optgroup label="Picnic">
<option>Mustard</option>
<option>Ketchup</option>
<option>Relish</option>
</optgroup>
<optgroup label="Camping">
<option>Tent</option>
<option>Flashlight</option>
<option>Toilet Paper</option>
</optgroup>
</select>
</div>
</div>
<div class="col-lg-3">
<button class="btn btn-primary">Show My Results</button>
</div>
</div>
</div>
</section>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN"
crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q"
crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl"
crossorigin="anonymous"></script>
<!-- Latest compiled and minified JavaScript -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.13.2/js/bootstrap-select.min.js"></script>
<!-- (Optional) Latest compiled and minified JavaScript translation files -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.13.2/js/i18n/defaults-*.min.js"></script>
<script>
$(document).ready(function () {
$('.selectpicker').selectpicker({
iconBase: 'fa',
tickIcon: 'fa-check',
});
});
</script>
</body>
</html>