# Dimension

Artifact: [androidx.annotation:annotation](https://developer.android.com/jetpack/androidx/releases/annotation) [View Source](https://cs.android.com/search?q=file:androidx/annotation/Dimension.jvm.kt+class:androidx.annotation.Dimension) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/annotation#1.0.0)

*** ** * ** ***

Common/AllAndroid/JVM
- android

  ```
  @MustBeDocumented
  @Retention(value = AnnotationRetention.BINARY)
  @Target(allowedTargets = [AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER, AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.FIELD, AnnotationTarget.LOCAL_VARIABLE, AnnotationTarget.ANNOTATION_CLASS])
  annotation Dimension
  ```

*** ** * ** ***

Denotes that an integer parameter, field or method return value is expected to represent a dimension.

## Summary

| ### Constants |
|---|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/annotation/Dimension#DP() = 0` | android |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/annotation/Dimension#PX() = 1` | android |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/annotation/Dimension#SP() = 2` | android |

| ### Public constructors |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/annotation/Dimension#Dimension(kotlin.Int)(unit: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)` | android |

| ### Public properties |
|---|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/annotation/Dimension#unit()` | android |

## Constants

### DP

android Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/annotation#1.5.0)

```
const val DP = 0: Int
```

### PX

android Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/annotation#1.5.0)

```
const val PX = 1: Int
```

### SP

android Added in [1.5.0](https://developer.android.com/jetpack/androidx/releases/annotation#1.5.0)

```
const val SP = 2: Int
```

## Public constructors

### Dimension

android Added in [1.10.0](https://developer.android.com/jetpack/androidx/releases/annotation#1.10.0)

```
Dimension(unit: Int = PX)
```

## Public properties

### unit

android

```
val unit: Int
```

Value is one of the following:

- `1`
- `0`
- `2`

<br />