# DictionaryLayout

> The layout the Inspector uses to present a serialized Dictionary field.

## Definition

* **Type:** Enum
* **Namespace:** [UnityEngine](/engine/6000.6/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule

```csharp
public enum DictionaryLayout
```

## Remarks

Set the layout with [DictionaryDisplayAttribute.layout](/engine/6000.6/script-reference/unityengine/dictionarydisplayattribute/layout.md) on a dictionary field, or with [DictionaryDisplayForTypeAttribute](/engine/6000.6/script-reference/unityengine/dictionarydisplayfortypeattribute.md) for a dictionary identified by type. The default is [DictionaryLayout.TwoColumns](/engine/6000.6/script-reference/unityengine/dictionarylayout/twocolumns.md).

The user can change the layout at any time from the dictionary header's context menu. Their choice persists and takes precedence over the value set by the attribute.

## Examples

```csharp
using System.Collections.Generic;
using UnityEngine;

public class SpawnSettings : MonoBehaviour
{
    // Stack each value under its key, behind a per-entry foldout.
    [DictionaryDisplay(layout = DictionaryLayout.OneColumnWithValueFoldout)]
    [SerializeField]
    private Dictionary<string, GameObject> spawnPoints = new Dictionary<string, GameObject>();
}
```

## Fields

| Value                                                                                                                  | Description                                                                                        |
| ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| [OneColumnWithValueFoldout](/engine/6000.6/script-reference/unityengine/dictionarylayout/onecolumnwithvaluefoldout.md) | Stacks each value under its key in a single column, with every value behind a collapsible foldout. |
| [OneColumnWithValueVisible](/engine/6000.6/script-reference/unityengine/dictionarylayout/onecolumnwithvaluevisible.md) | Stacks each value under its key in a single column, with every value always shown inline.          |
| [TwoColumns](/engine/6000.6/script-reference/unityengine/dictionarylayout/twocolumns.md)                               | Shows keys and values side by side in two resizable columns. This is the default layout.           |
