---
title: "Moon animated icon"
description: "Moon animated icon (Interface). Night falls. Light: the crescent rocks back on its curve and settles in two shrinking beats while two sparkle stars twinkle in beside it, one after the other, and fade. Strong: the crescent rocks deeper with more decaying beats, and each star twinkles twice before it fades."
canonical: https://generativeicons.com/icons/moon/
---

# Moon animated icon

Night falls. Light: the crescent rocks back on its curve and settles in two shrinking beats while two sparkle stars twinkle in beside it, one after the other, and fade. Strong: the crescent rocks deeper with more decaying beats, and each star twinkles twice before it fades.

- Id: `moon`
- Category: Interface
- Search terms: night, night mode, dark theme, crescent, bedtime, sleep mode, evening, nighttime, lunar
- One action, back to rest
- Styles: outline, solid, duotone; outline weights 1.5, 2, 2.5 (any from 1 to 3); motion light or strong
- File: https://generativeicons.com/assets/moon.lottie (dotLottie, 5273 bytes, sha256 12e481f96149f4fc7edd8b71b7e7326d44ceb39c11466ea305c910260a6704f0)
- License: MIT

## Install

```sh
npm install @lottiefiles/generative-icons-runtime
npx generative-icons init
npx generative-icons add moon
```

## React

```tsx
// npm install @lottiefiles/generative-icons-react
'use client';
import { AnimatedIcon } from '@lottiefiles/generative-icons-react';
import icon, { src } from './generative-icons/moon.mjs';

export function MoonIcon() {
  return <AnimatedIcon icon={icon} src={src} size={32}
    color="#ffffff" variant="outline" weight={2}
    motion="light" theme="dark" />;
}
```

## JavaScript

```js
import { createIcon } from '@lottiefiles/generative-icons-runtime';
import icon, { src } from './generative-icons/moon.mjs';

const handle = await createIcon(canvas, {
  icon, src,
  color: '#ffffff', style: 'outline', weight: 2,
  motion: 'light', theme: 'dark'
});
button.addEventListener('click', () => handle.play());
// On removal: handle.destroy();
```

More: https://generativeicons.com/icons/moon/ · https://generativeicons.com/api/icons/moon
