Magic Responsive Tables with Stimulus and IntersectionObserver

14-Jan-2021 1226
You’re working on this data table for your app. It’s mostly server-side HTML. Nothing fancy.But as you’re adding columns, you’ve got a problem. How are you going to handle small screens?The table has to scroll horizontally to let the user see all the columns. The table needs to become “responsive”.In this article, we’ll look at a side-scrolling widget used in Shopify’s Polaris UI toolkit (currently built in React), and we’ll recreate the functionality using just Stimulus without having to rewrite your data table in React.
Use coupon code:

RUBYONRAILS

to get 30% discount on our bundle!
Prepare for your next tech interview with our comprehensive collection of programming interview guides. Covering JavaScript, Ruby on Rails, React, and Python, these highly-rated books offer thousands of essential questions and answers to boost your interview success. Buy our 'Ultimate Job Interview Preparation eBook Bundle' featuring 2200+ questions across multiple languages. Ultimate Job Interview Preparation eBook Bundle