I am currently working on some code and have successfully hidden the sidebar using a collapse button. However, I am looking to make it collapse only for small devices, similar to how the bootstrap navbar functions.
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container">
<div class="container-fluid">
<div class="row">
<div class="col-md-3 px-1 bg-light" id="sidebar">
<div class="py-2 sticky-top flex-grow-1">
<div class="nav flex-sm-column">
<h2 class="text-center">PROFILE</h2>
<button class="btn btn-primary" type="button" data-toggle="collapse" data-target=".collapse" aria-expanded="true" aria-controls="collapse">Toggle both elements</button>
<div class="collapse navbar-collapse">
<a href="" class="nav-link">LINK</a>
<a href="" class="nav-link">LINK</a>
<a href="" class="nav-link">LINK</a>
</div>
</div>
</div>
</div>
<div class="col-sm-9" id="main">
***PAGE DATA
</div>
</div>
</div>
</div>