Diffs allow you to move a slider back and forth to compare two images, text, or any HTML.

Text / HTML Diff

Diffs are best when they show two mostly similar items that have only a few differences.

Preview
LocoMotion
LocoMotion
Code
= daisy_diff(css: "aspect-video max-w-[800px] max-h-[450px]") do |diff|
  - diff.with_item do
    .bg-primary.text-primary-content.grid.place-content-center.text-6xl.lg:text-8xl.font-black
      LocoMotion

  - diff.with_item do
    .bg-base-200.grid.place-content-center.text-6xl.lg:text-8xl.font-black
      LocoMotion

Image Diff

Here is an example using two images. One is blurred, and the other is the full-resolution image.

Preview
Code
= daisy_diff(css: "aspect-video max-w-[800px] max-h-[450px]") do |diff|
  - diff.with_item do
    = image_tag("landscapes/desert.jpg")

  - diff.with_item do
    = image_tag("landscapes/desert.jpg", class: "blur")
Made with by Profoundry .
Copyright © 2023-2025 Profoundry LLC.
All rights reserved.