# Editor.DockManager.AddDock

## Overload 1

```csharp
void AddDock(DockWidget widget, DockArea area)
```

Adds a [Editor.DockWidget](/api/Editor.DockWidget) into the given area.

### Parameters

- `widget` (`DockWidget`)
- `area` (`DockArea`)

## Overload 2

```csharp
void AddDock(DockWidget widget, DockArea area, DockWidget relativeTo)
```

Adds a [Editor.DockWidget](/api/Editor.DockWidget) into an area relative to an existing dock, splitting its space.
[Editor.DockArea.Center](/api/Editor.DockArea/Center) docks it as a tab. Pass null to dock relative to the whole window.

### Parameters

- `widget` (`DockWidget`)
- `area` (`DockArea`)
- `relativeTo` (`DockWidget`)

## Overload 3

```csharp
void AddDock(DockWidget widget, DockWidget tabWith)
```

Adds a [Editor.DockWidget](/api/Editor.DockWidget) as a tab alongside an existing dock.

### Parameters

- `widget` (`DockWidget`)
- `tabWith` (`DockWidget`)

## Overload 4

```csharp
DockWidget AddDock(string name, string icon, Widget widget, DockArea area = 1, DockWidget relativeTo = null)
```

Creates and docks a widget into the given area, registering it so it appears in view menus.
This is the primary entry point for adding docks. If a dock with this name already exists
(e.g. after a hotload), its content is replaced instead. Pass `relativeTo`
to place it relative to an existing dock instead - [Editor.DockArea.Center](/api/Editor.DockArea/Center) docks it
as a tab, other areas split the target dock's space.

### Parameters

- `name` (`string`)
- `icon` (`string`)
- `widget` (`Widget`)
- `area` (`DockArea`), default `1`
- `relativeTo` (`DockWidget`), default `null`

### Returns

`DockWidget`

## Overload 5

```csharp
void AddDock(DockInfo info)
```

Register a dock type and immediately create and dock it.

### Parameters

- `info` (`DockInfo`)

Declared in [Editor.DockManager](/api/Editor.DockManager).
Assembly: `Sandbox.Tools`.
