> ## 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

<ParamField path="viewUpdate" type="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.
</ParamField>

## Returns

<ResponseField name="Promise<void>">
  Returns a promise that resolves when the view is updated.
</ResponseField>

## 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 title="Do you need practical examples?" icon="text-align-start" href="https://www.ibm.com/docs/SSAVQO/deploy/web_chat_agent/tutorials/tutorials_lp.html" arrow="true" cta="Learn with walk-throughs" horizontal>
  Learn how to apply the features available for embedded chat into your implementation with guidance and examples.
</Card>
