# Liquid Button

> Fills to the brim with a rolling wave on hover.

An outline button holding a little liquid with a moving surface; hover or focus and it fills, the label changing colour as the tide passes.

- Family: Buttons
- Plan: Creative. Included with Creative.
- Requires: React, Tailwind CSS v4 and the motion package
- Page with a live preview: https://galactrex.com/ui/liquid-button/
- Licence: https://galactrex.com/ui/license/

## Install

```sh
npx @galactrex/ui login   # once, with an API key from https://galactrex.com/account/
npx @galactrex/ui add liquid-button
```

It installs to `components/galactrex/liquid-button.tsx`, with the shared motion helpers beside it. First time in a project: `npx @galactrex/ui init` (setup guide: https://galactrex.com/docs/ui-components-setup/).

## Usage

```tsx
import { LiquidButton } from "@/components/galactrex/liquid-button";

<LiquidButton onClick={topUp}>Top up</LiquidButton>
```

## Props

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| `children` | `ReactNode` | — | Label. |
| `level` | `number` | `0.18` | How full it rests, 0 to 1. |
| `...button props` | `ButtonHTMLAttributes` | — | onClick, disabled, type and the rest. |

## Variants

- **Fill up.** Game menus, 'top up' and refill actions.

## Accessibility

- Focus fills it like hover; label contrast flips with the fill.

## Motion

- Spring fill plus one looping path transform.
- Reduced motion: a still surface.
