ICONYZ
English
Lock icon from BoxIcons v2 Solid

Lock icon

bxs:lock

The Lock icon (bxs:lock) is a free SVG icon from the BoxIcons v2 Solid set by Boxicons. It is drawn on a 24 × 24 grid. BoxIcons v2 Solid 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
BoxIcons v2 Solid
Author
Boxicons
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" d="M12 2C9.243 2 7 4.243 7 7v3H6a2 2 0 0 0-2 2v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8a2 2 0 0 0-2-2h-1V7c0-2.757-2.243-5-5-5M9 7c0-1.654 1.346-3 3-3s3 1.346 3 3v3H9zm4 10.723V20h-2v-2.277a1.993 1.993 0 0 1 .567-3.677A2 2 0 0 1 14 16a1.99 1.99 0 0 1-1 1.723"/></svg>

How to use the Lock icon

React

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

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

Vue

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

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

Svelte

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

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

Tailwind CSS

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

UnoCSS

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

Web component

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

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

HTML image

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

Related icons in BoxIcons v2 Solid

Lock icon in other icon sets

Lock icon FAQ

Is the Lock icon free for commercial use?

Yes. BoxIcons v2 Solid 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="bxs: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/bxs/lock.svg" alt="Lock icon">, or paste the SVG code inline to style it with CSS.

Browse all BoxIcons v2 Solid icons →