# Duplicate Check block

> Duplicate contact dialog with ranked match candidates, a Link button per row and create new

Dedupe modal before saving a contact: candidates ranked by match score with Strong, Likely and Weak badges, matched email and company marked, a Link button per row and a Create new fallback. Dialog, Item, Avatar, Empty, ReUI Badge.

- Type: Pro block
- Category: [Dialog](https://reui.io/blocks/application/dialog.md)
- Page: https://reui.io/blocks/application/dialog/dialog-16
- Docs (Base UI): https://ui.shadcn.com/docs/components/base/dialog.md
- Docs (Radix UI): https://ui.shadcn.com/docs/components/radix/dialog.md
- MCP: `get_block("dialog-16")`
- Built with: Avatar, Badge, Button, Dialog, Empty, Item, Skeleton
- Installs with a ReUI Pro or Ultimate license; setup: https://reui.io/docs/license-setup

## Best for

Resolving a possible duplicate before save: ranked candidate records, each with its own Link button, plus a Create new fallback

## Agent notes

- Replace `INCOMING_CONTACT` and `CANDIDATES` with the record being saved and your matching results; `score` sets the order and the badge band
- Wire `onLink` and `onCreate` on `DuplicateMatchDialog`; `onLink` fires once the Undo toast closes, so the Undo stays honest against any backend

## Third-party libraries

- Sonner v2: [API reference](https://sonner.emilkowal.ski/toast), [docs](https://sonner.emilkowal.ski/getting-started)

## Install

```bash
npx shadcn@latest add @reui/dialog-16
```

## About Dialog blocks

### When to use

- New record forms over the current page: a project, a task or entry, an account, or a duplicate contact check
- Access flows: email invites with a role, an app picker and the consent step before a sync
- Pickers and account tasks: a time span, a starter template, settings, a checklist, cancellation or help

### When not to use

- A plain modal shell you fill with your own title, body and buttons: use [Dialog](https://reui.io/components/dialog.md) (`get_component("dialog")`)
- A data entry layout that sits in the page itself rather than over it: use the [Form blocks](https://reui.io/blocks/application/form.md)
- A one question confirm, such as deleting a record, with nothing to fill in: use [Alert Dialog](https://reui.io/components/alert-dialog.md) (`get_component("alert-dialog")`)

### Agent notes

- Each root renders its own launch `Button` and starts `open` as true in `useState`; swap in your trigger and start it closed
- Primary actions close through `setOpen`, fire a sonner `toast` or have no handler; wire your API call there or to dialog-16's `onLink` and `onCreate`
- Each page.tsx centers the root in a `min-h-svh` main with an `sr-only` h1; mount only the root component inside your page

Every ReUI item has a twin like this one; the index is https://reui.io/llms.txt. Agents with the ReUI MCP (https://reui.io/docs/mcp) get the same guidance from the getters named above.
