# Pixel like

A like button whose pixel heart fills like a glass.

Also called: like button, heart animation, like animation.

> 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: A heart that fills like a glass. Hover and a little liquid sloshes in the heart; like it and it fills from the bottom with bubbles, pops and throws an 8 bit burst while the count rolls. Preview: https://chatcn.dev/preview/pixel-like-demo

Hover and a little liquid sloshes in the bottom of the heart. Like it and the heart fills from the bottom up, the surface a dithered wave with bubbles rising through it. When it is full the heart pops on a spring, throws a burst of 8 bit sparks snapped to its own pixel grid and gets its shine, and the count rolls like an odometer. Unlike drains it back down.

## Installation

```bash
npx shadcn@latest add @chatcn-pro/pixel-like
```

## Usage

```tsx
import { PixelLike } from "@/components/ui/chatcn/pro/pixel-like"

<PixelLike liked={liked} onLikedChange={setLiked} count={likes} />
```

## Props

| Prop | Type | Notes |
| --- | --- | --- |
| `liked` / `defaultLiked` / `onLikedChange` | `boolean` |  |
| `count` | `number` | Including this like when liked; rolls once the heart is full |
| `label` | `string` | Default Like |

## Accessibility

- A toggle button with `aria-pressed`; the heart is decoration.

## Motion

- Fills in 900 ms and drains in 560 ms; the pop is a spring. Reduced motion: the heart fills at once with no burst.

Source: https://chatcn.dev/docs/components/pixel-like