2 ms·
When I made a split panel web component recently I used a range input slider for the user interaction and tied it to a CSS variable for updating the layout. It'
by onion2k 6y ago
When I made a split panel web component recently I used a range input slider for the user interaction and tied it to a CSS variable for updating the layout. It's a much simpler than the approach in the article[1], and comes with a few big advantages like being accessible, the user can click anywhere in the window to move the slider (or drag the slider itself), and it's really simple to extend[2] because it's mostly just HTML.
[1] It's 100 lines of code as a web component but it could be much smaller - https://codepen.io/onion2k/pen/dyMaBKO?editors=0010 https://codepen.io/onion2k/pen/dyMaBKO?editors=0010
[2] Fork it and change stuff - https://github.com/onion2k/split-view https://github.com/onion2k/split-view