# Redact sweep

Redaction you watch happen: a marker bar sweeps across each sensitive span and you can hold to peek.

Also called: redaction animation, redact text.

> chatcn Pro: needs a Pro license (https://chatcn.dev/pro). Install from the `@chatcn-pro` registry with your license token; setup at https://chatcn.dev/docs/chatcn-pro.

Example: Redaction you watch happen. A marker bar sweeps across each sensitive span in reading order and leaves a bar that still says what it hid; press and hold to peek. Preview: https://chatcn.dev/preview/redact-sweep-demo

When the text is redacted a marker bar sweeps across each sensitive span in reading order, laying ink over it like a pen stroke, and the span becomes a dark bar that still says what it hid. Press and hold a bar to peek: the ink draws back while you hold. Covered text cannot be read or copied.

## Installation

```bash
npx shadcn@latest add @chatcn-pro/redact-sweep
```

## Usage

```tsx
import { RedactSweep } from "@/components/ui/chatcn/pro/redact-sweep"

<RedactSweep parts={["Card ", { secret: "4417 2210 9981 4417", label: "card number" }]} redacted={hide} />
```

## Props

| Prop | Type | Notes |
| --- | --- | --- |
| `parts` | `(string | { secret, label })[]` |  |
| `redacted` | `boolean` | Turning it on plays the sweep |
| `peek` | `boolean` | Hold to peek. Default true |

## Keyboard

| Key | Action |
| --- | --- |
| `Space` / `Enter` held | Peek at the focused span |

## Accessibility

- Covered spans read as Hidden card number; with peek they are buttons labelled Hold to peek.

## Motion

- A `clip-path` wipe per span, 360 ms, 140 ms apart. Reduced motion: they cover at once.

Source: https://chatcn.dev/docs/components/redact-sweep