> ## Documentation Index
> Fetch the complete documentation index at: https://developer.watson-orchestrate.ibm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# changeView()

Updates the chat UI view by showing or hiding the launcher, main window, or both. Use this method to programmatically control the visibility of chat components.

## Syntax

```javascript theme={null}
await instance.changeView(viewUpdate);
```

## Parameters

**viewUpdate** `string | object` *required*

Either a string key ('launcher' or 'mainWindow') or an object with optional `launcher` or `mainWindow`, or both boolean properties to control their visibility.

## Returns

**Promise\<void>**

Returns a promise that resolves when the view is updated.

## Examples

The following examples show different ways to update the view:

```javascript theme={null}
// Show the main window and hide the launcher
await instance.changeView({ launcher: false, mainWindow: true });

// Toggle just the launcher
await instance.changeView({ launcher: true });

// Use string shorthand to show main window
await instance.changeView('mainWindow');
```

> [card] [Do you need practical examples?](https://www.ibm.com/docs/SSAVQO/deploy/web_chat_agent/tutorials/tutorials_lp.html)
>
> Learn how to apply the features available for embedded chat into your implementation with guidance and examples.
