---
title: "Ionic Capacitor SDK: Widget control"
description: "Open and close the Gleap widget programmatically with the Gleap Ionic Capacitor SDK. Follow the integration code examples."
url: https://docs.gleap.ai/en/articles/584-ionic-capacitor-sdk-widget-control
collection: "Ionic / Capacitor"
updated: 2026-11-01
language: en
---

# Ionic Capacitor SDK: Widget control

Open and close the Gleap widget programmatically with the Gleap Ionic Capacitor SDK. Follow the integration code examples.

In some situations you might want to take full control over showing or hiding the Gleap widget. This can be achieved with the following methods.

### Open the Gleap widget

```javascript
Gleap.open();
```

### Close the Gleap widget

```javascript
Gleap.close();
```

> **Info:** If you want to get notified of certain events, check out the [events](https://gleap-developer-docs.gleap.help/en/articles/578-ionic-capacitor-sdk-callbacks) documentation page.

### Widget open status

It's possible to request the widget open status with the following method.

```javascript
const isOpened = Gleap.isOpened();
```

## Related

- [Ionic Capacitor SDK setup](https://docs.gleap.ai/en/articles/563-ionic-capacitor-sdk-setup.md)
- [Ionic Capacitor SDK: User identity](https://docs.gleap.ai/en/articles/564-ionic-capacitor-sdk-user-identity.md)
- [Ionic Capacitor SDK: Frontend tools](https://docs.gleap.ai/en/articles/565-ionic-capacitor-sdk-frontend-tools.md)
- [Ionic Capacitor SDK: Track events](https://docs.gleap.ai/en/articles/566-ionic-capacitor-sdk-track-events.md)
- [Ionic Capacitor SDK: Track pages](https://docs.gleap.ai/en/articles/567-ionic-capacitor-sdk-track-pages.md)
