• About
  • Projects
  • Contact
  • LinkedIn
  • GitHub

A better comparison slider for mobile

The standard comparison slider works well on desktop. On mobile, two problems get in the way. Here's how I fixed them.

Mar 2026

Visual Studio CodeVisual Studio CodeShadcnShadcnExcalidrawExcalidraw
A better comparison slider for mobile

The comparison slider is one of the more useful components on this site. It lets you scrub between two states of a design and see the difference directly. On desktop it works well. On mobile, it has two problems that quietly undermine the whole point of it.

I noticed them while reviewing my own portfolio on my phone, fixed them, and documented the process here.

The problems

The first is thumb obstruction

When you drag the handle across the image, your thumb sits directly over the area you're trying to evaluate. The comparison you're making is hidden by your own hand. It's a fundamental conflict between the control and the content.

A better comparison slider for mobile
Thumb covers the area you're trying to evaluate. The handle and the content occupy the same space.

The second is scroll interference

The horizontal drag gesture competes with the vertical scroll of the page. The result is a shaky, unpredictable interaction that feels broken even when it technically isn't.

Your browser does not support the video tag.
Dragging the handle horizontally conflicts with vertical page scroll, causing the page to judder behind the gesture.

Neither of these problems exists on desktop, where a mouse cursor is precise and weightless. On mobile, the interaction needs a different approach entirely.

See for yourself

A better comparison slider for mobile — before
A better comparison slider for mobile — after
If you're reading this on your phone, try it now. If you're on desktop, take my word for it.

The solution

Control placement

Moving the slider handle beneath the image removes the obstruction entirely. Your thumb operates in a dedicated zone below the content, and the full image stays visible while you interact with it. The comparison does what it's supposed to do.

A better comparison slider for mobile
The handle moves below the image, out of the content area.

Caption placement

With the control moving below the image, the caption moves above it. This keeps the label readable at all times, regardless of where the handle sits.

A better comparison slider for mobile
The caption moves above the image, always readable.

The result is a cleaner separation between the content being compared and the mechanism driving the interaction. Each element has its own space.

Preventing scroll interference

Stopping the page from scrolling while the user is dragging requires one explicit instruction: passive: false. Without it, the browser handles the touch event before your code can, and the page moves anyway.

comparison-slider-block.tsx
Preventing page scroll during slider interaction by calling preventDefault() on touch events

The result

Same scene, very different company.
A better comparison slider for mobile — before
A better comparison slider for mobile — after

Reflection

The fix sounds simple in hindsight, but getting there involved a few rounds of sketching the interaction model. The main question was whether a detached slider would still feel connected to the image, or whether it would read as a separate, unrelated control.

The answer was in the visual proximity and the immediate feedback. As long as the image responds in real time to the slider position, the relationship is clear. The handle doesn't need to be on the image to feel like it controls it.

This kind of problem is easy to miss during design and build, because you're mostly working on desktop. Mobile testing surfaces a whole category of issues that just don't exist at cursor scale.

The broader principle: drag interactions on mobile need to account for the thumb as an object that takes up space and blocks what's behind it. Designing the control zone separately from the content zone is often the right call.

There's more that could be done here. A tap-to-advance interaction as an alternative to dragging, better touch target sizing, or haptic feedback at the midpoint. For now, the core problem is solved.

Share on LinkedIn

Other projects

Designing my portfolio like a product
2026 · Product Design
Designing my portfolio like a product

Built a portfolio website from scratch, treating it as a product design challenge with audience research, technical decision-making, and a content system designed to scale.

Building a product from scratch at an early-stage startup
2026 · Startup
Building a product from scratch at an early-stage startup

I joined as the first designer at a behavioural intelligence startup and established everything from the ground up, translating a raw brand into a coherent design system and fully realised product.

Reducing churn for a global subscription service
2025 · UX Research
Reducing churn for a global subscription service

Led UX research and prototyping to tackle customer churn and improve personalisation for an ink subscription service.

Cutting through the noise with short-form sales content
2024 · Motion Design
Cutting through the noise with short-form sales content

Produced a series of short videos to help a global tech company communicate its value to sales teams and partners.

Designing a smarter GenAI workflow for AI developers
2024 · User Research
Designing a smarter GenAI workflow for AI developers

Led UX research and product design to reshape how data scientists and developers create GenAI projects inside an enterprise AI platform.

Validating demand for a low-cost learning device in India
2024 · User Research
Validating demand for a low-cost learning device in India

Built a fake door website to test what students in India actually value in an affordable learning device.

Building a scalable design system for a global risk platform
2023 · Design Systems
Building a scalable design system for a global risk platform

Designed and delivered a modular design system to bring consistency and speed to two enterprise products.

Optimising the digital shopping experience for a home improvement retailer
2023 · User Experience (UX)
Optimising the digital shopping experience for a home improvement retailer

Used research and UX analysis to uncover friction points and improve conversions across key product journeys.

Understanding a diverse diaspora audience
2023 · User Interviews
Understanding a diverse diaspora audience

Led discovery research and persona development to help a community organisation connect with a wider, more diverse audience.

Designing my portfolio like a product
2026 · Product Design
Designing my portfolio like a product

Built a portfolio website from scratch, treating it as a product design challenge with audience research, technical decision-making, and a content system designed to scale.

Building a product from scratch at an early-stage startup
2026 · Startup
Building a product from scratch at an early-stage startup

I joined as the first designer at a behavioural intelligence startup and established everything from the ground up, translating a raw brand into a coherent design system and fully realised product.

Reducing churn for a global subscription service
2025 · UX Research
Reducing churn for a global subscription service

Led UX research and prototyping to tackle customer churn and improve personalisation for an ink subscription service.

Cutting through the noise with short-form sales content
2024 · Motion Design
Cutting through the noise with short-form sales content

Produced a series of short videos to help a global tech company communicate its value to sales teams and partners.

Designing a smarter GenAI workflow for AI developers
2024 · User Research
Designing a smarter GenAI workflow for AI developers

Led UX research and product design to reshape how data scientists and developers create GenAI projects inside an enterprise AI platform.

Validating demand for a low-cost learning device in India
2024 · User Research
Validating demand for a low-cost learning device in India

Built a fake door website to test what students in India actually value in an affordable learning device.

Building a scalable design system for a global risk platform
2023 · Design Systems
Building a scalable design system for a global risk platform

Designed and delivered a modular design system to bring consistency and speed to two enterprise products.

Optimising the digital shopping experience for a home improvement retailer
2023 · User Experience (UX)
Optimising the digital shopping experience for a home improvement retailer

Used research and UX analysis to uncover friction points and improve conversions across key product journeys.

Understanding a diverse diaspora audience
2023 · User Interviews
Understanding a diverse diaspora audience

Led discovery research and persona development to help a community organisation connect with a wider, more diverse audience.