---
title: "Animated Undo Icon"
description: "A curved arrow for Undo and Redo buttons. On hover it swings back. It flips in right-to-left pages."
url: https://gelatinui.com/components/animated-undo-icon
markdown_url: https://gelatinui.com/components/animated-undo-icon.md
access: free
install: "npx shadcn@latest add @gelatin-ui/animated-undo-icon"
registry_item: https://gelatinui.com/r/animated-undo-icon.json
version: "2026-11-13"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Animated Undo Icon

> A curved arrow for Undo and Redo buttons. On hover it swings back. It flips in right-to-left pages.

Page: https://gelatinui.com/components/animated-undo-icon

## When to use it

Best for: The Undo and Redo buttons of an editor toolbar.

- Set `direction="redo"` for Redo.
- Put it in an icon Button with an `aria-label`.

## When not to use it

- For reload or sync, use the [Animated Refresh Icon](https://gelatinui.com/components/animated-refresh-icon.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.
- It flips in right to left, so undo still points to the start side.
- It plays once per hover or keyboard focus of the control around it. Set `trigger="none"` and count `play` to play it from code.
- The icon is `aria-hidden`. The control around it owns the name.

## Anatomy

```text
AnimatedUndoIcon
```

## API reference

### AnimatedUndoIcon

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `direction` | `"redo" \| "undo"` | "undo" | `undo` (default): the head on the start side. `redo`: the head on the end side. |
| `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). |

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| AnimatedUndoIcon | `animated-undo-icon` |  |  |  |

## Usage

Import Animated Undo Icon and compose its parts.

```tsx title="animated-undo-icon.tsx"
import { AnimatedUndoIcon } from "@/components/icons/animated-undo-icon";

export function AnimatedUndoIconDemo() {
  return <AnimatedUndoIcon />;
}
```

## 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-undo-icon
```

It adds 14 registry items: 13 files, 2469 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

## Related

- [Animated Trash Icon](https://gelatinui.com/components/animated-trash-icon.md)
- [Animated Sun Moon Icon](https://gelatinui.com/components/animated-sun-moon-icon.md)

## Accessibility

The icon is hidden from assistive tools. The control around it owns the name.
