# UxmlAttributeField

> Creates an unbound field. Set _bindingPath to bind it to a serialized property.

## Definition

* **Type:** Constructor
* **Namespace:** [Unity.UIToolkit.Editor](/engine/6000.7/script-reference/unity/uitoolkit/editor.md)
* **Assembly:** UnityEditor

## UxmlAttributeField()

Creates an unbound field. Set [\_bindingPath](/engine/6000.7/script-reference/unity/uitoolkit/editor/uxmlattributefield/bindingpath.md) to bind it to a serialized property.

```csharp
public UxmlAttributeField()
```

### Remarks

The field starts unbound. Set [\_bindingPath](/engine/6000.7/script-reference/unity/uitoolkit/editor/uxmlattributefield/bindingpath.md) to bind it, or use [UxmlAttributeField](/engine/6000.7/script-reference/unity/uitoolkit/editor/uxmlattributefield/ctor.md) to bind it when you create it.

The following example creates an unbound field and sets [\_bindingPath](/engine/6000.7/script-reference/unity/uitoolkit/editor/uxmlattributefield/bindingpath.md) to bind it.

### Examples

```csharp
var field = new UxmlAttributeField();
field.bindingPath = "text";
container.Add(field);
```

## UxmlAttributeField(SerializedProperty)

Creates a field bound to the given serialized property.

```csharp
public UxmlAttributeField(SerializedProperty property)
```

### Parameters

**** (\[SerializedProperty]\(/engine/6000.7/script-reference/unityeditor/serializedproperty)): The property to display and edit. Pass null to create an unbound field.

### Remarks

When `property` is null, the field starts unbound. Set [\_bindingPath](/engine/6000.7/script-reference/unity/uitoolkit/editor/uxmlattributefield/bindingpath.md) after you create it, or use the parameterless constructor.

The following example creates a field bound to a property from `FindPropertyRelative`.

### Examples

```csharp
var textProperty = property.FindPropertyRelative("text");
if (textProperty != null)
{
    var field = new UxmlAttributeField(textProperty);
    field.label = "Text Content";
    container.Add(field);
}
```
