# TreeViewArgs

Interface · extends [`ContainerArgs`](https://api.playcanvas.com/pcui/interfaces/ContainerArgs.md)

Source: https://github.com/playcanvas/pcui/blob/77ed2b8ba8660c9644049b0d1942652721e7a6c4/src/components/TreeView/index.ts#L42

The arguments for the [TreeView](https://api.playcanvas.com/pcui/classes/TreeView.md) constructor.

## Properties

### allowDrag

```ts
allowDrag?: boolean
```

Whether dragging a [TreeViewItem](https://api.playcanvas.com/pcui/classes/TreeViewItem.md) is allowed. Defaults to `true`.

### allowRenaming

```ts
allowRenaming?: boolean
```

Whether renaming [TreeViewItem](https://api.playcanvas.com/pcui/classes/TreeViewItem.md)s is allowed by double clicking on them. Defaults to `false`.

### allowReordering

```ts
allowReordering?: boolean
```

Whether reordering [TreeViewItem](https://api.playcanvas.com/pcui/classes/TreeViewItem.md)s is allowed. Defaults to `true`.

### dragScrollElement

```ts
dragScrollElement?: Element
```

The element to scroll on drag. Defaults to this [TreeView](https://api.playcanvas.com/pcui/classes/TreeView.md)'s element.

### filter

```ts
filter?: string
```

A filter that searches [TreeViewItem](https://api.playcanvas.com/pcui/classes/TreeViewItem.md)s and only shows the ones that are relevant to the filter.

### onContextMenu

```ts
onContextMenu?: (evt: MouseEvent, item: TreeViewItem) => void
```

A function to be called when we right click on a [TreeViewItem](https://api.playcanvas.com/pcui/classes/TreeViewItem.md).

### onReparent

```ts
onReparent?: (reparented: ReparentedItem[]) => void
```

A function to be called when we try to reparent tree items. If a function is provided then the
tree items will not be reparented by the [TreeView](https://api.playcanvas.com/pcui/classes/TreeView.md) but instead will rely on the function to
reparent them as it sees fit.

## Inherited from [ContainerArgs](https://api.playcanvas.com/pcui/interfaces/ContainerArgs.md)

- `alignItems?: string`
- `alignSelf?: string`
- `binding?: BindingBase`
- `children?: ReactNode`
- `class?: string | string[]`
- `dom?: string | HTMLElement`
- `enabled?: boolean`
- `error?: boolean`
- `flex?: boolean`
- `flexBasis?: string | number`
- `flexDirection?: string`
- `flexGrow?: string | number`
- `flexShrink?: string | number`
- `flexWrap?: string`
- `grid?: boolean`
- `height?: number`
- `hidden?: boolean`
- `id?: string`
- `ignoreParent?: boolean`
- `isRoot?: boolean`
- `justifyContent?: string`
- `justifySelf?: string`
- `link?: { observer: Observer | Observer[]; path: string | string[] }`
- `onChange?: (value: unknown) => void`
- `onClick?: () => void`
- `onRemove?: () => void`
- `onResize?: () => void`
- `parent?: Element`
- `readOnly?: boolean`
- `resizable?: string`
- `resizeMax?: number`
- `resizeMin?: number`
- `scrollable?: boolean`
- `style?: string`
- `tabIndex?: number`
- `width?: number`
