# Length

> Creates from a float and an optional LengthUnit.

## Definition

* **Type:** Constructor
* **Namespace:** [UnityEngine.UIElements](/engine/6000.5/script-reference/unityengine/uielements.md)
* **Assembly:** UnityEngine.UIElementsModule

## Length(float)

Creates from a float and an optional [LengthUnit](/engine/6000.5/script-reference/unityengine/uielements/lengthunit.md).

```csharp
public Length(float value)
```

### Parameters

**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)):&#x20;

### Remarks

[LengthUnit.Pixel](/engine/6000.5/script-reference/unityengine/uielements/lengthunit/pixel.md) is the default unit.

## Length(float, LengthUnit)

Creates from a float and an optional [LengthUnit](/engine/6000.5/script-reference/unityengine/uielements/lengthunit.md).

```csharp
public Length(float value, LengthUnit unit)
```

### Parameters

**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): **** (\[LengthUnit]\(/engine/6000.5/script-reference/unityengine/uielements/lengthunit)):&#x20;

### Remarks

[LengthUnit.Pixel](/engine/6000.5/script-reference/unityengine/uielements/lengthunit/pixel.md) is the default unit.
