Kinetic UI
Back to Introduction
AI & Generative

LLM Compare Slider

A split-screen comparison widget with token-by-token diff highlighting and interactive response evaluation cards.

Quick Actions
CLI Installation
npx kinetic-ui-cli@latest add llm-compare-slider
LLM Compare Slider
GPT-4

Here is a generic explanation of quantum computing:

Quantum computing is a rapidly-emerging technology that harnesses the laws of quantum mechanics to solve problems too complex for classical computers.

Time: 2.4s | Tokens: 45
Claude 3 Opus

Here is an intuitive explanation of quantum computing:

Think of classical computing as a coin that can only show Heads or Tails. Quantum computing is like a coin spinning in the air—it can represent multiple states simultaneously.

Time: 1.8s | Tokens: 62

Installation

npx kinetic-ui-cli@latest add llm-compare-slider

Usage

This component utilizes CSS clip-path: polygon(...) tied to an interactive slider handle mapped from 0% to 100%.

It is extremely useful for A/B testing AI models, visualizing RAG (Retrieval-Augmented Generation) improvements, or showing prompt engineering "before/after" results. Pass arbitrary React node children to modelA_Content and modelB_Content to compare anything from raw text to complete UI widgets.

Usage Guide

1. Import the Component

Import the component into your React or Next.js page:

import { LlmCompareSlider } from "@/components/creative/llm-compare-slider";

2. Implementation Example

Render the component and customize its behavior by passing props:

import { LlmCompareSlider } from "@/components/creative/llm-compare-slider";

export default function Example() {
  return (
    <div className="w-full flex items-center justify-center p-8">
      <LlmCompareSlider
        modelA_Name="example"
        modelB_Name="example"
        modelA_Content{/* value */}
      />
    </div>
  );
}
Performance Notes
  • Uses CSS hardware acceleration via GPU transform-binds.
  • Damped interpolation minimizes paint-redraw flashes.
  • Tree-shakable import: only compiles elements requested.
Accessibility Notes
  • Full keyboard focus-ring navigation support (`Tab`/`Shift+Tab`).
  • ARIA roles mapped correctly for assistive screen readers.
  • Respects `prefers-reduced-motion` system toggles.