# X Octagon animated icon

> X Octagon animated icon with a click replay interaction for React and shadcn/ui. Download the Lottie JSON or SVG, free under MIT.

X Octagon is a 1.13 s micro animation from the alerts set that replays on every click, like Alert octagon and Octagon. Click icons typically confirm send, save, refresh, download, add-to-cart and formatting buttons.

## Facts

- Interaction: [Click replay](https://useanimations.com/interactions/click-replay). Replays once from the start on every click unless reduced motion is preferred.
- Category: [Alerts](https://useanimations.com/categories/alerts)
- Duration: 1.13 s at 30 fps
- Artboard: 32 × 32 px
- Lottie size: 2.4 kB
- License: MIT, attribution optional ([Licencing & Terms](https://useanimations.com/licencing-and-terms))

## Files

- Lottie JSON: https://useanimations.com/icons/x-octagon.json
- Static SVG (x-octagon): https://useanimations.com/icons/x-octagon/x-octagon.svg
- ZIP (Lottie JSON and SVGs): https://useanimations.com/icons/x-octagon.zip
- shadcn registry item: https://useanimations.com/r/x-octagon.json
- Web page: https://useanimations.com/icons/x-octagon

## React

```bash
npm install react-useanimations
```

```jsx
import UseAnimations from 'react-useanimations';
import xOctagon from 'react-useanimations/lib/xOctagon';

<UseAnimations animation={xOctagon} size={32} />
```

## shadcn/ui

```bash
npx shadcn@latest add https://useanimations.com/r/x-octagon.json
```

```tsx
import { AnimatedXOctagon } from '@/components/animations/x-octagon';

<AnimatedXOctagon size={24} />
```

## HTML and lottie-web

```html
<div id="x-octagon-icon" style="width: 48px; height: 48px"></div>

<script src="https://cdn.jsdelivr.net/npm/lottie-web@5.13.0/build/player/lottie_light.min.js"></script>
<script>
  const el = document.getElementById('x-octagon-icon');
  const a = lottie.loadAnimation({ container: el, renderer: 'svg', loop: false, autoplay: false, path: 'https://useanimations.com/icons/x-octagon.json' });
  const motion = matchMedia('(prefers-reduced-motion: reduce)');
  el.addEventListener('click', () => { if (!motion.matches) a.playSegments([0, a.totalFrames], true); });
</script>
```

## FAQ

### Do fast clicks on X Octagon queue up?

No queue: every click restarts the 1.13 s run from the first frame. With reduced motion preferred, clicks still reach your onClick but the icon stays still.

### Should the X Octagon icon be a <button>?

Put its events on a real button with the render prop: render={(events, icon) => <button aria-label="X Octagon" {...events}><span {...icon} /></button>}. The animation itself stays aria-hidden.

### Can X Octagon play on hover instead?

Yes: pass interaction="hover-replay". It then plays once on mouseenter unless reduced motion is preferred. Leaving does not stop it; entering during playback does not restart it.

## Related icons

- [Alert octagon](https://useanimations.com/icons/alert-octagon) (loop)
- [Octagon](https://useanimations.com/icons/octagon) (hover-replay)
- [Alert circle](https://useanimations.com/icons/alert-circle) (loop)
- [Alert triangle](https://useanimations.com/icons/alert-triangle) (loop)
- [Error](https://useanimations.com/icons/error) (loop)

[All alerts icons](https://useanimations.com/categories/alerts) · [All icons](https://useanimations.com/icons)
