> 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)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.carpose.de/components/09_vehicle-comparison.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
