To achieve fewer grid columns on small devices in Tailwind CSS, you can utilize the responsive grid classes.
Tailwind follows a mobile-first approach. This means by default, the styles defined for smaller screens (like sm breakpoint) apply, and you can progressively enhance them for larger screens using responsive classes.
Use responsive prefixes like md (medium), lg (large) etc., with grid column classes to define the desired number of columns on larger devices.
<div class="grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 xl:grid-cols-5">
<!-- Your grid items here -->
</div>