ZYVOPMulti-Platform Sync
SeriesAI NewsWhy ZyVOPJoin Discord
LoginGet Started
ZYVOPMulti-Platform Sync

The Developer Publishing Hub. Write once, publish everywhere, and make your work citation-ready with built-in SEO, AEO, and GEO discovery support. Zero reader paywalls.

Content

  • Categories
  • Tags
  • Badges
  • Leaderboard
  • Write Article
  • Newsletter

Company

  • About Us
  • Why ZyVOP
  • Developer API & CLI
  • Write for Us
  • Contact

Connect

  • Privacy Policy
  • Terms of Service
  • Cookie Policy
  • DMCA Policy
  • Code of Conduct

© 2026 ZyVOP. Developer Publishing Hub.

Zero paywalls · Full content ownership
All systems operational
HomeMantine Compare: A Sleek, Accessible Way to Showcase Before/After in React

Mantine Compare: A Sleek, Accessible Way to Showcase Before/After in React

Giovambattista Fazioli
Giovambattista Fazioli
Senior Full-stack Engineer, Lead DeveloperSupport
September 4, 2026
3 min read
Mantine Compare: A Sleek, Accessible Way to Showcase Before/After in React
#Programming#reactjsdevelopment#TypeScript#webcomponents

Mantine Compare brings polished, responsive side‑by‑side comparisons to your Next.js + TypeScript projects with zero friction.

If you build product previews, image diff views, A/B demos, or UI changelogs, Mantine Compare is the extension that turns “quick comparison” into a delightful experience. Designed to pair perfectly with the Mantine UI Library, it ships with consistent styling, accessibility, and flexible layout controls—so you can focus on storytelling, not boilerplate.

Mantine Compare

Why Mantine Compare stands out 

Mantine Compare is an interactive container that reveals two content sections—images or custom React nodes—along a movable divider. You get a smooth UI, keyboard‑friendly controls, and a Styles API that lets you tailor every inner element. In practice, this means you can compare two product states, designs, or datasets with just a few lines of code while preserving your brand look and feel.

Key highlights:

  • Angle control for the divider: vertical, horizontal, or diagonal with any angle between 0–360.

  • Three interaction variants: drag (default), hover, and fixed—each suited to different storytelling patterns.

  • Works with any React content: not just images; pass custom components, charts, or annotated boxes.

  • Full Styles API support: style the slider, line, sections, and root with classNames across your theme.

Installation and setup in seconds 

Add the package, then import styles at your app root:

// install// yarn add @gfazioli/mantine-compare// or npm i @gfazioli/mantine-compare

// styles: pick one of the followingimport '@gfazioli/mantine-compare/styles.css';// or, with CSS layersimport '@gfazioli/mantine-compare/styles.layer.css';

Enter fullscreen mode Exit fullscreen mode


 

With Mantine and Next.js, this fits right into your App Router structure and theming model. If you’re new to Mantine, start here: the official Getting Started guide. For a broader view of community components, explore the Mantine Extensions HUB.

Use cases that shine 

  • Product “Before/After” reveals: demonstrate upgrades like performance, color correction, or UI polish.

  • Design reviews: compare two versions of a layout, component, or icon set.

  • Data visualizations: show state changes over time with charts or dashboards on either side.

  • Documentation demos: embed in Nextra or MDX pages to make release notes visual and interactive.

A clean API you’ll enjoy using 

The core component accepts two sections—left and right—and renders them inside a resizable frame:

import { Compare } from '@gfazioli/mantine-compare';import { Image } from '@mantine/core';

export function ProductDiff() {return (
    <Compare
      leftSection={
        <Image
          src="https://images.unsplash.com/photo-1506905925346-21bda4d32df4?w=800&auto=format&fit=crop"
          alt="Before"
          style={{ width: '100%', height: '100%', objectFit: 'cover' }}
        />
      }
      rightSection={
        <Image
          src="https://images.unsplash.com/photo-1519681393784-d120267933ba?w=800&auto=format&fit=crop"
          alt="After"
          style={{ width: '100%', height: '100%', objectFit: 'cover' }}
        />
      }
    />);}

Enter fullscreen mode Exit fullscreen mode

Need a horizontal or diagonal split? Set the angle:

  • angle={0}: classic vertical divider (left/right).

  • angle={90}: horizontal divider (top/bottom).

  • angle={30} (or any 0–360): diagonal for more dynamic reveals.

<Compare angle={30} leftSection={...} rightSection={...} />

Enter fullscreen mode Exit fullscreen mode

Prefer non‑interactive reveals? Choose a variant:

  • drag (default): click and drag the slider.

  • hover: reveal by moving the cursor; no slider button.

  • fixed: static split at a preset percentage via defaultPosition.

<Compare variant="fixed" defaultPosition={35} leftSection={...} rightSection={...} />

Enter fullscreen mode Exit fullscreen mode

Styling with precision 

Mantine Compare embraces Mantine’s Styles API, exposing classNames hooks like root, leftSection, rightSection, slider, sliderLine, and sliderButton. This gives you granular control to sync with your theme, support dark mode, and integrate brand motion or colors—without hacking CSS.

Styling

Example targets:

  • root: the container

  • leftSection/rightSection: wrappers for content panes

  • slider/sliderLine: the draggable element and its accent line

  • sliderButton: the clickable area for accessibility and hit target

 Built for modern Mantine workflows 

  • Accessible by default: focus targets and interaction affordances are thoughtfully designed.

  • Responsive: fills parent dimensions and adapts to different aspect ratios.

  • Composable: accepts any React node—Mantine components, charts, or custom containers.

  • TypeScript‑friendly: props and variants are straightforward and IDE‑discoverable.

If you develop with Mantine daily, Mantine Compare feels native—familiar props, predictable styling, and polished UX out of the box.

Where to explore more 

  • Mantine UI Library: https://mantine.dev/getting-started/ ↗

  • Mantine Extensions HUB: https://mantine-extensions.vercel.app/ ↗

These resources give you everything you need to scaffold, theme, and document your comparisons in production‑ready apps.

Final thoughts 

Mantine Compare turns content comparison into a premium, interactive experience. Whether you’re shipping product showcases, design diffs, or data reveals, it’s a small component that makes a big impression—and it plugs seamlessly into your Next.js + TypeScript + Mantine stack. Install it, style it, and start telling better visual stories today.

Comments (0)

Login to post a comment.

Giovambattista Fazioli
Giovambattista Fazioli

Senior Full-stack Engineer, Lead Developer

Italian Senior Full-stack Engineer and Lead Developer on the Cloud team at Namecheap. I build developer tools, React/Mantine UI components and native macOS apps — mostly open source. I work across TypeScript, Next.js, Go and SwiftUI, and I've been coding since the Commodore/Assembly days. Creator of WP Bones and 25+ Mantine extensions, and maintainer of the Undolog open-source studio.

Support
Subscribe to Giovambattista Fazioli's Newsletter

More from Giovambattista Fazioli

View profile

FinderGit 0.29.0 — open a commit like a folder

There’s a moment, reading a commit list, where you want to know one small thing: which files did that one touch?

3 minSep 4

Netfox 0.18.0 — is it my connection, or the internet?

There is a question that comes up every time something feels slow, and until now Netfox could not...

3 minSep 4

Mantine Book — Grab Any Edge, Turn Any Page

A realistic iBooks-style book for React built on Mantine: stack two-sided pages and turn them by...

5 minSep 4

Netfox — The macOS app that never loses track of your network

I built Netfox because every existing answer to "what's actually on my network?" annoyed me. The...

5 minSep 4

Audio That Sees Itself

A Mantine-native audio player for React with waveform visualisation and a live spectrum analyser,...

5 minSep 4