# lock Icon

> The lock icon from Material as Compose ImageVector Kotlin code, Android Vector Drawable XML and SVG.

- Library: [Material Icons](https://composables.com/icons/icon-libraries/material-icons.md)
- License: Apache 2.0 (full text in the [Material Icons library page](https://composables.com/icons/icon-libraries/material-icons.md))
- Styles: [Filled](https://composables.com/icons/icon-libraries/material-icons/lock.md?v=filled), [Outlined](https://composables.com/icons/icon-libraries/material-icons/lock.md?v=outlined), [Rounded](https://composables.com/icons/icon-libraries/material-icons/lock.md?v=rounded), [Sharp](https://composables.com/icons/icon-libraries/material-icons/lock.md?v=sharp), [Two-Tone](https://composables.com/icons/icon-libraries/material-icons/lock.md?v=twotone)
- Categories: [Action](https://composables.com/icons/categories/action.md)

## Compose ImageVector (Kotlin)

For Jetpack Compose and Compose Multiplatform. Download: `https://composables.com/download/icons/material-icons/lock.kt`

```kotlin
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.SolidColor
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.graphics.vector.group
import androidx.compose.ui.graphics.vector.path
import androidx.compose.ui.unit.dp

val MaterialIconsLock: ImageVector
    get() {
        if (_MaterialIconsLock != null) return _MaterialIconsLock!!
        
        _MaterialIconsLock = ImageVector.Builder(
            name = "lock",
            defaultWidth = 24.dp,
            defaultHeight = 24.dp,
            viewportWidth = 24f,
            viewportHeight = 24f
        ).apply {
            group {
                path(
                    fill = SolidColor(Color.Transparent)
                ) {
                    moveTo(0f, 0f)
                    horizontalLineToRelative(24f)
                    verticalLineToRelative(24f)
                    horizontalLineTo(0f)
                    verticalLineTo(0f)
                    close()
                }
                path(
                    fill = SolidColor(Color.Transparent)
                ) {
                    moveTo(0f, 0f)
                    horizontalLineToRelative(24f)
                    verticalLineToRelative(24f)
                    horizontalLineTo(0f)
                    verticalLineTo(0f)
                    close()
                }
            }
            path(
                fill = SolidColor(Color.Black)
            ) {
                moveTo(18f, 8f)
                horizontalLineToRelative(-1f)
                verticalLineTo(6f)
                curveToRelative(0f, -2.76f, -2.24f, -5f, -5f, -5f)
                reflectiveCurveTo(7f, 3.24f, 7f, 6f)
                verticalLineToRelative(2f)
                horizontalLineTo(6f)
                curveToRelative(-1.1f, 0f, -2f, 0.9f, -2f, 2f)
                verticalLineToRelative(10f)
                curveToRelative(0f, 1.1f, 0.9f, 2f, 2f, 2f)
                horizontalLineToRelative(12f)
                curveToRelative(1.1f, 0f, 2f, -0.9f, 2f, -2f)
                verticalLineTo(10f)
                curveToRelative(0f, -1.1f, -0.9f, -2f, -2f, -2f)
                close()
                moveTo(9f, 6f)
                curveToRelative(0f, -1.66f, 1.34f, -3f, 3f, -3f)
                reflectiveCurveToRelative(3f, 1.34f, 3f, 3f)
                verticalLineToRelative(2f)
                horizontalLineTo(9f)
                verticalLineTo(6f)
                close()
                moveToRelative(9f, 14f)
                horizontalLineTo(6f)
                verticalLineTo(10f)
                horizontalLineToRelative(12f)
                verticalLineToRelative(10f)
                close()
                moveToRelative(-6f, -3f)
                curveToRelative(1.1f, 0f, 2f, -0.9f, 2f, -2f)
                reflectiveCurveToRelative(-0.9f, -2f, -2f, -2f)
                reflectiveCurveToRelative(-2f, 0.9f, -2f, 2f)
                reflectiveCurveToRelative(0.9f, 2f, 2f, 2f)
                close()
            }
        }.build()
        
        return _MaterialIconsLock!!
    }

private var _MaterialIconsLock: ImageVector? = null
```

## Android Vector Drawable (XML)

Download: `https://composables.com/download/icons/material-icons/lock.xml`

```xml
<vector xmlns:android="http://schemas.android.com/apk/res/android"
    android:width="24dp"
    android:height="24dp"
    android:viewportWidth="24"
    android:viewportHeight="24">
    <path
        android:fillColor="@android:color/black"
        android:pathData="M0,0h24v24H0V0Z" />
    <path
        android:fillColor="@android:color/black"
        android:pathData="M0,0h24v24H0V0Z" />
    <path
        android:fillColor="@android:color/black"
        android:pathData="M18,8h-1V6c0,-2.76 -2.24,-5 -5,-5S7,3.24 7,6v2H6c-1.1,0 -2,0.9 -2,2v10c0,1.1 0.9,2 2,2h12c1.1,0 2,-0.9 2,-2V10c0,-1.1 -0.9,-2 -2,-2ZM9,6c0,-1.66 1.34,-3 3,-3s3,1.34 3,3v2H9V6Zm9,14H6V10h12v10Zm-6,-3c1.1,0 2,-0.9 2,-2s-0.9,-2 -2,-2s-2,0.9 -2,2s0.9,2 2,2Z" />
</vector>
```

## SVG

Download: `https://composables.com/download/icons/material-icons/lock.svg`

```svg
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><g fill="none"><path d="M0 0h24v24H0V0z"/><path d="M0 0h24v24H0V0z" opacity=".87"/></g><path d="M18 8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zM9 6c0-1.66 1.34-3 3-3s3 1.34 3 3v2H9V6zm9 14H6V10h12v10zm-6-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z"/></svg>
```
