
Hi, I don't think there is an SLDS class specifically that enables scrolling if you have large amounts of data, however an easy way to enable this using standard CSS is to do the following:
<style>
.scrollable {
height: 400px; <!-- Don't need this if it's okay for height to be dynamic -->
overflow-y:auto;
}
</style>
<div class="slds-page-header">
<p class="slds-text-heading--label">Contacts</p>
<h1>My Contacts</h1>
</div>
<div class="scrollable">
<!-- The rest of the page goes here -->
</div>
EDIT: As @techbusinessman wrote in a comment below, there is now a standard utility class for making a div scrollable. The documentation can be found here:
The code would now be as follows:
<div class="slds-page-header">
<p class="slds-text-heading--label">Contacts</p>
<h1>My Contacts</h1>
</div>
<div class="slds-scrollable">
<!-- The rest of the page goes here -->
</div>
Hope this helps.
Please mark this as solved if it's resolved so that it gets removed from the unanswered queue which results in helping others who are encountering a similar issue.Thanks,Nagendra
3 answers