---
title: "width"
description: "Sets the absolute width of an element, in [Dp]."
type: "function"
---

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


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


```kotlin
public fun GlanceModifier.width(width: Dp): GlanceModifier
```


Sets the absolute width of an element, in `Dp`.



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


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


Set the width of a view from the value of a resource.



