> For the complete documentation index, see [llms.txt](https://docs.carpose.de/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.carpose.de/components/09_vehicle-comparison.md).

# Vehicle Comparison

{% hint style="warning" %}
Vehicle Comparison is a **feature of the** [**Vehicle Search Form**](/vehicle-search-modules/01_vehicle-search-form.md), not a standalone embeddable component. There is no `data-carpose-component="comparison"` — it is enabled with the `data-compare` attribute on the search form.
{% endhint %}

## Introduction

When comparison is enabled, visitors can add up to **3 vehicles** to a comparison list (persisted in `localStorage`) and view them side by side in a modal. The comparison shows key specifications — price and VAT, registration date and mileage, power and engine, transmission and fuel type, and additional specs.

## Enabling Comparison

```html
<div
  data-carpose-component="vehicle-search-form"
  data-api-key="your-api-key"
  data-compare="true"
></div>
```

## Behavior

* A comparison button appears on vehicle cards and detail pages (including an icon overlay on thumbnails), and a floating comparison button opens the side-by-side view
* Comparison state persists across sessions via `localStorage`
* Responsive layout: 1 vehicle (full width), 2 vehicles (50/50), 3 vehicles (equal thirds); mobile uses a horizontal scroll view
* A warning is shown when trying to add more than 3 vehicles

## Notes

* Can be combined with the [Wishlist](/components/08_wishlist.md) (`data-wishlist="true"`)
* For the full list of search-form options, see the [Vehicle Search Form](/vehicle-search-modules/01_vehicle-search-form.md)
