---
title: "Code file animated icon"
description: "Code file animated icon (Files & folders). Code is written into the file. Light: the brackets spring apart and a slash slides out of the left bracket into the gap, so the sheet reads </> for a beat; then the slash tucks back and the brackets snap shut, quicker than they opened. Strong: the brackets fly wider with the slash, overshoot and settle on </>, hold, snap shut and rebound once."
canonical: https://generativeicons.lottiefiles.com/icons/code-file/
---

# Code file animated icon

Code is written into the file. Light: the brackets spring apart and a slash slides out of the left bracket into the gap, so the sheet reads </> for a beat; then the slash tucks back and the brackets snap shut, quicker than they opened. Strong: the brackets fly wider with the slash, overshoot and settle on </>, hold, snap shut and rebound once.

- Id: `code-file`
- Category: Files & folders
- Search terms: source file, source code, script, script file, html, css, js, javascript, json, xml, markup, program file
- 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.lottiefiles.com/assets/code-file.lottie (dotLottie, 3935 bytes, sha256 a92aadfbe9acb017ca445d3966e572844e1d80e1b31cc2592108dd0618a7c5ae)
- License: MIT

## Install

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

## React

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

export function CodeFileIcon() {
  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/code-file.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.lottiefiles.com/icons/code-file/ · https://generativeicons.lottiefiles.com/api/icons/code-file
