---
title: "Animated Heart Icon"
description: "A heart for a Like toggle. On each like it fills, pops, and sends out small particles. It beats on hover."
url: https://gelatinui.com/components/animated-heart-icon
markdown_url: https://gelatinui.com/components/animated-heart-icon.md
access: pro
install: "npx shadcn@latest add @gelatin-ui-pro/animated-heart-icon"
version: "2026-11-13"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Animated Heart Icon

> A heart for a Like toggle. On each like it fills, pops, and sends out small particles. It beats on hover.

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

## When to use it

Best for: A Like toggle: the heart pops with a pulse and a burst on like, and beats on hover.

- Use it in a Like or Favorite toggle.
- Set `checked` from the liked state. A change to `true` plays the pop.
- Set `--animated-heart-icon-color` to change the liked color.

## When not to use it

- For a Save or Read later toggle, use the [Animated Bookmark Icon](https://gelatinui.com/components/animated-bookmark-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.
- `checked` is the liked state. The default is `false`.
- `trigger` is `hover` by default: the hover or the keyboard focus of the control plays one soft double beat.
- The liked color is `--animated-heart-icon-color` (the text color by default). The outline is the text color.
- The icon is `aria-hidden`. Put `aria-pressed` and the name on the button.

## Anatomy

```text
AnimatedHeartIcon
```

## API reference

### AnimatedHeartIcon

| 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). |
| `checked` | `boolean` | false | Liked: the heart fills and, on each change to `true`, pops with a pulse and a burst. |
| `burst` | `boolean` | true | The pulse ring and the particles on like. Default `true`. Set `false` when the control around the icon draws its own burst (Social Action), so two bursts never stack. |

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| AnimatedHeartIcon | `animated-heart-icon` |  | `--animated-heart-icon-color` |  |

## Usage

Set `checked` from the liked state, and put `aria-pressed` on the button.

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-pro/animated-heart-icon @gelatin-ui/button
```

```tsx title="like-button.tsx"
import { useState } from "react";

import { AnimatedHeartIcon } from "@/components/pro/icons/animated-heart-icon";
import { Button } from "@/components/ui/button";

export function LikeButton() {
  const [liked, setLiked] = useState(false);
  return (
    <Button
      variant="ghost"
      size="icon"
      aria-label="Like"
      aria-pressed={liked}
      onClick={() => {
        setLiked((current) => {
          return !current;
        });
      }}
    >
      <AnimatedHeartIcon checked={liked} />
    </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-pro/animated-heart-icon
```

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

- [Button](https://gelatinui.com/components/button.md)
- [Toggle](https://gelatinui.com/components/toggle.md)
- [Animated Bookmark Icon](https://gelatinui.com/components/animated-bookmark-icon.md)

## Accessibility

The icon is hidden from assistive tools. Put the name and `aria-pressed` on the button.

## Motion

| Part | Motion |
| --- | --- |
| Like | panel · the heart squeezes and pops, a ring pulses out, and 8 rays fly out |
| Hover | iconHover · one soft double beat |
