---
title: "padding"
description: "Apply additional space along each edge of the content in [Dp]: [start], [top], [end] and
[bottom]. The start and end edges will be determined by layout direction of the current locale.
Padding is applied before content measurement and takes precedence; content may only be as large
as the remaining space.

If any value is not defined, it will be [0.dp] or whatever value was defined by an earlier
modifier."
type: "function"
---

<div class='type'>Function</div>


<a id='references'></a>
<div class='sourceset sourceset-android'>Android</div>


```kotlin
public fun GlanceModifier.padding(
    start: Dp = 0.dp,
    top: Dp = 0.dp,
    end: Dp = 0.dp,
    bottom: Dp = 0.dp,
): GlanceModifier
```


Apply additional space along each edge of the content in `Dp`: `start`, `top`, `end` and
`bottom`. The start and end edges will be determined by layout direction of the current locale.
Padding is applied before content measurement and takes precedence; content may only be as large
as the remaining space.

If any value is not defined, it will be `0.dp` or whatever value was defined by an earlier
modifier.



<div class='sourceset sourceset-android'>Android</div>


```kotlin
public fun GlanceModifier.padding(
    @DimenRes start: Int = 0,
    @DimenRes top: Int = 0,
    @DimenRes end: Int = 0,
    @DimenRes bottom: Int = 0,
): GlanceModifier
```


Apply additional space along each edge of the content in `Dp`: `start`, `top`, `end` and
`bottom`. The start and end edges will be determined by layout direction of the current locale.
Padding is applied before content measurement and takes precedence; content may only be as large
as the remaining space.

If any value is not defined, it will be `0.dp` or whatever value was defined by an earlier
modifier.



<div class='sourceset sourceset-android'>Android</div>


```kotlin
public fun GlanceModifier.padding(horizontal: Dp = 0.dp, vertical: Dp = 0.dp): GlanceModifier
```


Apply `horizontal` dp space along the left and right edges of the content, and `vertical` dp
space along the top and bottom edges.

If any value is not defined, it will be `0.dp` or whatever value was defined by an earlier
modifier.



<div class='sourceset sourceset-android'>Android</div>


```kotlin
public fun GlanceModifier.padding(
    @DimenRes horizontal: Int = 0,
    @DimenRes vertical: Int = 0,
): GlanceModifier
```


Apply `horizontal` dp space along the left and right edges of the content, and `vertical` dp
space along the top and bottom edges.

If any value is not defined, it will be `0.dp` or whatever value was defined by an earlier
modifier.



<div class='sourceset sourceset-android'>Android</div>


```kotlin
public fun GlanceModifier.padding(all: Dp): GlanceModifier
```


Apply `all` dp of additional space along each edge of the content, left, top, right and bottom.



<div class='sourceset sourceset-android'>Android</div>


```kotlin
public fun GlanceModifier.padding(@DimenRes all: Int): GlanceModifier
```


Apply `all` dp of additional space along each edge of the content, left, top, right and bottom.



