---
title: "Animated Copy Icon"
description: "A copy icon that turns into a check after a copy, or a cross when the copy fails. Use it in a copy button."
url: https://gelatinui.com/components/copy-button
markdown_url: https://gelatinui.com/components/animated-copy-icon.md
access: free
install: "npx shadcn@latest add @gelatin-ui/animated-copy-icon"
registry_item: https://gelatinui.com/r/animated-copy-icon.json
version: "2026-11-08"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Animated Copy Icon

> A copy icon that turns into a check after a copy, or a cross when the copy fails. Use it in a copy button.

Page: https://gelatinui.com/components/copy-button

## When to use it

Best for: The icon of a copy control that turns into a check after a copy, or a cross when it fails.

- Use it in a copy control and set `state` to `idle`, `copied`, or `error`.
- Set `statusColors` for a green check and a red cross.

## When not to use it

- For a ready button that copies a value and changes its icon, use the [Copy Button](https://gelatinui.com/components/copy-button.md).

## Notes for agents

- `variant` (`stroke`, `solid`, `duotone`, `twotone`, `bulk`) and `corners` (`round`, `sharp`) pick the style. Use one style for every icon of a product.
- The icon is `aria-hidden`: the control around it must say "Copied" in words.
- A new `state` in the middle of a move turns back from where the strokes are.

## Anatomy

```text
AnimatedCopyIcon
```

## API reference

### AnimatedCopyIcon

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `variant` | `"bulk" \| "duotone" \| "solid" \| "stroke" \| "twotone"` |  | `stroke` (default): 1.5 strokes. `solid`: the body filled, inner details cut through. `duotone`: a 40% fill under the stroke. `twotone`: the details at 40%. `bulk`: the body filled at 40% with no outline, the details at full color. |
| `corners` | `"round" \| "sharp"` |  | `round` (default): round caps and joins, soft corners. `sharp`: square caps, miter joins. |
| `trigger` | `"hover" \| "none"` |  | `hover` (default) plays once per hover or keyboard focus of the control around the icon. |
| `play` | `number` |  | Plays once each time this number changes (a new notice, a saved form). |
| `state` | `"copied" \| "error" \| "idle"` | "idle" | `copied` draws a bare check, `error` a bare cross with a wobble. Default `idle`. |
| `statusColors` | `boolean` | false | Status colors for the marks: the check takes the success color and the cross the destructive color (the `-soft-foreground` tokens). Default `false`: both take the text color. |

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| AnimatedCopyIcon | `animated-copy-icon` |  |  | `status-colors` |

## Compose

Rules:

- Compose the parts (`compose-parts`): Build each item from its named parts as children, and pass your text and icons in as parts.
- Every state is designed (`every-state`): Give each view of data its loading, empty, and error states: a skeleton in the final layout, an `Empty` with an illustration and one next action, and an error that says what failed and how to retry.

## Add it

```bash
npx shadcn@latest add @gelatin-ui/animated-copy-icon
```

It adds 15 registry items: 13 files, 2621 lines, and the npm packages `@base-ui/react`, `@mantine/hooks`, `clsx`, `motion`, `tailwind-merge`, `tailwind-variants`.

## For AI agents

- Every item, one file: https://gelatinui.com/llms.txt
- MCP server (`search_items`, `get_item`, `get_install_plan`): https://gelatinui.com/mcp
