# Range Copy Preview
URL: https://pro.rv-grid.com/guides/data-manage/range-copy-preview/
Source: src/content/docs/guides/data-manage/range-copy-preview.mdx
Description: Shows ghost values for the exact range copy that will be applied on drop.
`RangeCopyPreviewPlugin` shows the copied values that will be applied when a user
drags a selected range with the fill handle. It is a view-only companion plugin:
the data store is not changed until the existing drop-time range copy flow runs.

Use it when users need confidence that a drag will repeat the selected source
range exactly, without AutoFill sequence inference.

  Select the first two or three populated rows in the demo, drag the fill handle
  downward, and the empty target cells show ghost copied values before mouseup.

## Usage

```ts
import { RangeCopyPreviewPlugin } from '@revolist/revogrid-pro';

const grid = document.createElement('revo-grid');
grid.range = true;
grid.plugins = [RangeCopyPreviewPlugin];
```

The plugin uses the same core drag signal as range copy. It does not need
configuration for the default behavior.

## User Behavior

1. Select a source cell or range.
2. Drag the fill handle to a larger target range.
3. Target cells show the exact copied values in a ghost style.
4. Source cells remain visually unchanged.
5. Release the mouse to apply the core range copy.

If the temporary range is cleared, the source changes, or the plugin is destroyed,
the preview is removed immediately.

## Difference From AutoFill Preview

`AutoFillPreviewPlugin` previews smart sequence output from `AutoFillPlugin`, such
as `1, 2` becoming `3, 4` or `Mon, Tue` becoming `Wed`.

`RangeCopyPreviewPlugin` previews exact range copy output:

```txt
Draft, Approved -> Draft, Approved, Draft, Approved
North, West -> North, West, North, West
```

Use one preview plugin at a time for this drag surface:

| Plugin | Preview intent |
| --- | --- |
| `AutoFillPreviewPlugin` | Show predicted smart AutoFill sequence values. |
| `RangeCopyPreviewPlugin` | Show exact copied source values. |

## Rendering

Preview cells receive:

- attribute: `range-copy-preview`
- class: `range-copy-preview-cell`

Default styling uses reduced opacity and italic text so users can distinguish
preview values from committed data.

```css
.range-copy-preview-cell {
  opacity: 0.45;
  font-style: italic;
}
```

## Notes

The plugin does not mutate `source`, `newData`, or provider stores. It only
overrides the render model during `beforecellrender`, then refreshes affected row
types in a frame batch.
