# Length

> Represents a distance value.

## Definition

* **Type:** Struct
* **Namespace:** [UnityEngine.UIElements](/engine/6000.0/script-reference/unityengine/uielements.md)
* **Assembly:** UnityEngine.UIElementsModule
* **Implements:** [IEquatable\<Length>](https://learn.microsoft.com/dotnet/api/system.iequatable-1)

```csharp
public struct Length : IEquatable<Length>
```

## Constructors

| Constructor                                                                                                                                                 | Description                                                                                                              |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------ |
| [Length(System.Single)](/engine/6000.0/script-reference/unityengine/uielements/length/ctor.md#length\(float\))                                              | Creates from a float and an optional [LengthUnit](/engine/6000.0/script-reference/unityengine/uielements/lengthunit.md). |
| [Length(System.Single,UnityEngine.UIElements.LengthUnit)](/engine/6000.0/script-reference/unityengine/uielements/length/ctor.md#length\(float-lengthunit\)) | Creates from a float and an optional [LengthUnit](/engine/6000.0/script-reference/unityengine/uielements/lengthunit.md). |

## Properties

| Property                                                                        | Description                     |
| ------------------------------------------------------------------------------- | ------------------------------- |
| [unit](/engine/6000.0/script-reference/unityengine/uielements/length/unit.md)   | The unit of the value property. |
| [value](/engine/6000.0/script-reference/unityengine/uielements/length/value.md) | The length value.               |

## Methods

| Method                                                                            | Description              |
| --------------------------------------------------------------------------------- | ------------------------ |
| [IsAuto](/engine/6000.0/script-reference/unityengine/uielements/length/isauto.md) | Check if Length is Auto. |
| [IsNone](/engine/6000.0/script-reference/unityengine/uielements/length/isnone.md) | Check if Length is None. |

## Static Methods

| Method                                                                              | Description                                                                                                   |
| ----------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- |
| [Auto](/engine/6000.0/script-reference/unityengine/uielements/length/auto.md)       | Creates an Auto Length [Length](/engine/6000.0/script-reference/unityengine/uielements/length.md).            |
| [None](/engine/6000.0/script-reference/unityengine/uielements/length/none.md)       | Creates a None Length [Length](/engine/6000.0/script-reference/unityengine/uielements/length.md).             |
| [Percent](/engine/6000.0/script-reference/unityengine/uielements/length/percent.md) | Creates a percentage [Length](/engine/6000.0/script-reference/unityengine/uielements/length.md) from a float. |
