---
title: "Traffic light animated icon"
description: "Traffic light animated icon (Maps & navigation). Light: red fades to a dot as amber grows, then amber gives way to green. Strong: red drops, amber pops in and holds, and green lands with a small overshoot; reverse runs the signal back to red."
canonical: https://generativeicons.com/icons/traffic-light/
---

# Traffic light animated icon

Light: red fades to a dot as amber grows, then amber gives way to green. Strong: red drops, amber pops in and holds, and green lands with a small overshoot; reverse runs the signal back to red.

- Id: `traffic-light`
- Category: Maps & navigation
- Search terms: traffic signal, stoplight, stop light, red light, green light, amber light, yellow light, intersection, junction
- Two states: stop to go, played forward and back
- 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/traffic-light.lottie (dotLottie, 14891 bytes, sha256 397a5e232942ae05425433e6e66ee543eec2ea376f5ccb29e3a655769d8d48d5)
- License: MIT

## Install

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

## React

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

export function TrafficLightIcon() {
  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/traffic-light.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/traffic-light/ · https://generativeicons.com/api/icons/traffic-light
