---
title: "Animated Battery Icon"
description: "A battery for a Charging, Battery saver, or Power button. On hover the bolt flashes and the charge sweeps up."
url: https://gelatinui.com/components/animated-battery-icon
markdown_url: https://gelatinui.com/components/animated-battery-icon.md
access: pro
install: "npx shadcn@latest add @gelatin-ui-pro/animated-battery-icon"
version: "2026-11-24"
index: https://gelatinui.com/llms.txt
docs_index: https://gelatinui.com/docs/llms.txt
---

# Animated Battery Icon

> A battery for a Charging, Battery saver, or Power button. On hover the bolt flashes and the charge sweeps up.

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

## When to use it

Best for: A Start charging or Battery saver button: the bolt flashes and the charge sweeps up on hover.

- Use it in a button or a link about charging or power.
- Set `play` to a new number to play the sweep with no hover, for example when charging starts.

## When not to use it

- For a theme switch, use the [Animated Sun Moon Icon](https://gelatinui.com/components/animated-sun-moon-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.
- `trigger` is `hover` by default: the hover or the keyboard focus of the control plays one sweep. Set `none` to play only on `play`.
- The icon does not show a real charge level. Show the level as text next to it.
- The icon is `aria-hidden`. Put the name on the button.

## Anatomy

```text
AnimatedBatteryIcon
```

## API reference

### AnimatedBatteryIcon

| 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). |

## Styling

| Part | Slot | States | CSS variables | Tokens |
| --- | --- | --- | --- | --- |
| AnimatedBatteryIcon | `animated-battery-icon` |  |  |  |

## Usage

Put the icon in the button before the label.

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-battery-icon @gelatin-ui/button
```

```tsx title="start-charging-button.tsx"
import { AnimatedBatteryIcon } from "@/components/pro/icons/animated-battery-icon";
import { Button } from "@/components/ui/button";

export function StartChargingButton() {
  return (
    <Button>
      <AnimatedBatteryIcon data-icon="inline-start" />
      Start charging
    </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-battery-icon
```

It adds 14 registry items: 13 files, 2500 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)
- [Progress](https://gelatinui.com/components/progress.md)
- [Animated Sun Moon Icon](https://gelatinui.com/components/animated-sun-moon-icon.md)

## Accessibility

The icon is hidden from assistive tools. Put the name on the button.

## Motion

| Part | Motion |
| --- | --- |
| Hover | iconHover · the charge grows from the start side and fades, and the bolt flashes once |
