ICONYZ
English
Lock icon from Bootstrap Icons

Lock icon

bi:lock

The Lock icon (bi:lock) is a free SVG icon from the Bootstrap Icons set by The Bootstrap Authors. It is drawn on a 24 × 24 grid. Bootstrap Icons are released under the MIT license, which allows use in personal and commercial projects. Copy it as SVG, JSX, Vue or Svelte code, or download the SVG file.

Icon set
Bootstrap Icons
Author
The Bootstrap Authors
License
MIT
Size
24 × 24
Download SVG

SVG code

<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path fill="currentColor" fill-rule="evenodd" d="M8 0a4 4 0 0 1 4 4v2.05a2.5 2.5 0 0 1 2 2.45v5a2.5 2.5 0 0 1-2.5 2.5h-7A2.5 2.5 0 0 1 2 13.5v-5a2.5 2.5 0 0 1 2-2.45V4a4 4 0 0 1 4-4M4.5 7A1.5 1.5 0 0 0 3 8.5v5A1.5 1.5 0 0 0 4.5 15h7a1.5 1.5 0 0 0 1.5-1.5v-5A1.5 1.5 0 0 0 11.5 7zM8 1a3 3 0 0 0-3 3v2h6V4a3 3 0 0 0-3-3"/></svg>

How to use the Lock icon

React

import { Icon } from "@iconify/react";

<Icon icon="bi:lock" width="24" />

Vue

<script setup>
import { Icon } from "@iconify/vue";
</script>

<template>
  <Icon icon="bi:lock" width="24" />
</template>

Svelte

<script>
  import Icon from "@iconify/svelte";
</script>

<Icon icon="bi:lock" width="24" />

Tailwind CSS

<!-- @iconify/tailwind plugin -->
<span class="icon-[bi--lock]"></span>

UnoCSS

<!-- @unocss/preset-icons + @iconify-json/bi -->
<div class="i-bi:lock"></div>

Web component

<script src="https://code.iconify.design/iconify-icon/2.1.0/iconify-icon.min.js"></script>

<iconify-icon icon="bi:lock"></iconify-icon>

HTML image

<img src="https://iconyz.com/api/public/svg/bi/lock.svg" alt="Lock icon" width="24" height="24">

Related icons in Bootstrap Icons

Lock icon in other icon sets

Lock icon FAQ

Is the Lock icon free for commercial use?

Yes. Bootstrap Icons are released under the MIT license, which allows use in personal and commercial projects.

How do I use the Lock icon in React?

Install @iconify/react and render <Icon icon="bi:lock" />, or use “Copy code” on this page to get a standalone React component.

How do I add the Lock icon to a web page?

Link the SVG file in an image tag: <img src="https://iconyz.com/api/public/svg/bi/lock.svg" alt="Lock icon">, or paste the SVG code inline to style it with CSS.

Browse all Bootstrap Icons →