---
title: "Animated Eye Icon"
description: "An eye for Show and Hide buttons. It blinks on hover, and a slash draws across it when the value is hidden."
url: https://gelatinui.com/components/animated-eye-icon
markdown_url: https://gelatinui.com/components/animated-eye-icon.md
access: free
install: "npx shadcn@latest add @gelatin-ui/animated-eye-icon"
registry_item: https://gelatinui.com/r/animated-eye-icon.json
version: "2026-11-13"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Animated Eye Icon

> An eye for Show and Hide buttons. It blinks on hover, and a slash draws across it when the value is hidden.

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

## When to use it

Best for: A show or hide button, such as the eye of a password field.

- Use it in a control that shows or hides something.
- Use `off` for the hidden state. The slash draws across the eye.
- Use it in a button, so hover and keyboard focus play one blink.

## When not to use it

- For a full password input with this toggle, use a [Password Field](https://gelatinui.com/components/password-field.md).
- Do not use it alone as a control. Put it in a button that has a name.

## 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 has no name of its own. The control around it owns the name.
- `off` defaults to `false`, the open eye.
- `PasswordFieldToggle` already draws this icon. Do not add a second one.
- Hover and focus come from the control around it. The `trigger` and `play` props change this.

## Anatomy

```text
AnimatedEyeIcon
```

## API reference

### AnimatedEyeIcon

| 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). |
| `off` | `boolean` | false | Off: a slash draws across the eye (hidden text, camera off). Default: the open eye. |

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| AnimatedEyeIcon | `animated-eye-icon` |  |  |  |

## Usage

Pass `off` for the slash. The icon has no name of its own, so the control around it owns the name.

The sample also uses `button`, which this add does not write. One command adds them with this item:

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

```tsx title="show-value-button.tsx"
import { AnimatedEyeIcon } from "@/components/icons/animated-eye-icon";
import { Button } from "@/components/ui/button";

export function ShowValueButton() {
  return (
    <Button variant="outline" size="icon-lg" aria-label="Show">
      <AnimatedEyeIcon />
    </Button>
  );
}
```

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

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

- [Password Field](https://gelatinui.com/components/password-field.md)
- [Toggle](https://gelatinui.com/components/toggle.md)
- [Button](https://gelatinui.com/components/button.md)

## Accessibility

The icon has no name of its own. The control around it owns the name.

Hover and focus come from the control around it. The `trigger` and `play` props change this.
