---
title: "Key animated icon"
description: "Key animated icon (Tools). The key unlocks. Light: the rigid key pushes in along its shaft and seats with a dead stop, turns on its inserted tip and stops with a click, then turns back and withdraws, quicker and smaller than the action. Strong: a short draw-back before a harder push that bounces on seating, a wider turn that clicks and rebounds, then the same quick return. The key never bends."
canonical: https://generativeicons.com/icons/key/
---

# Key animated icon

The key unlocks. Light: the rigid key pushes in along its shaft and seats with a dead stop, turns on its inserted tip and stops with a click, then turns back and withdraws, quicker and smaller than the action. Strong: a short draw-back before a harder push that bounces on seating, a wider turn that clicks and rebounds, then the same quick return. The key never bends.

- Id: `key`
- Category: Tools
- Search terms: unlock, access, door key, house key, keys, access key, lock and key, keyring, secret key
- 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/key.lottie (dotLottie, 3086 bytes, sha256 396f7aac1bdd67ba79e524830028e61d3b1a1fd79e9150e0b209c64c3605ada1)
- License: MIT

## Install

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

## React

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

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