---
title: "Train animated icon"
description: "Train animated icon (Travel). The train sets off. Light: the coupling rod drives the wheels through one full turn as the train pulls forward along the rail; the carriage sits back on its springs at the start, pitches forward once and settles, and the train eases back onto its spot. Strong: the couplings take up slack first (a small jolt back), then the rod drives two turns, the pull is longer and the carriage rocks deeper with a two-beat settle. The rail never moves; the carriage, wheels and rod stay rigid."
canonical: https://generativeicons.com/icons/train/
---

# Train animated icon

The train sets off. Light: the coupling rod drives the wheels through one full turn as the train pulls forward along the rail; the carriage sits back on its springs at the start, pitches forward once and settles, and the train eases back onto its spot. Strong: the couplings take up slack first (a small jolt back), then the rod drives two turns, the pull is longer and the carriage rocks deeper with a two-beat settle. The rail never moves; the carriage, wheels and rod stay rigid.

- Id: `train`
- Category: Travel
- Search terms: railway, railroad, rail, locomotive, steam engine, train station, railway station, commuter rail, intercity, rail travel
- 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/train.lottie (dotLottie, 4407 bytes, sha256 8c690e30bf2407df22701f65ac66abb2d7fefd1e03a460cb446f9b9fa3839944)
- License: MIT

## Install

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

## React

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

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