e01.org

VirtualKeyboard: boundingRect property

VirtualKeyboard API

VirtualKeyboard API

The **`boundingRect`** property of the VirtualKeyboard interface contains a DOMRect indicating the position and size of the on-screen virtual keyboard that overlays the web page.

The on-screen virtual keyboard will overlay the viewport when the Virtual Keyboard API is used to prevent the browser from resizing the viewport automatically. This is done by setting the overlaysContent property to `true`.

## Value

A DOMRect which indicates the position and size of the virtual keyboard in the viewport.

The `x`, `y`, `width`, and `height` coordinates of the rectangle are useful to reposition content in the webpage that needs to be visible even when the virtual keyboard is displayed.

```js
const { x, y, width, height } = navigator.virtualKeyboard.boundingRect;
```

## Specifications

## Browser compatibility

## See also

- The VirtualKeyboard API
- [Full control with the VirtualKeyboard API](https://developer.chrome.com/docs/web-platform/virtual-keyboard/)

source: MDN Web Docs mirror · page

Cite this

"VirtualKeyboard: boundingRect property". MDN Web Docs. CC BY-SA 2.5 (MDN). https://developer.mozilla.org/en-US/docs/Web/API/VirtualKeyboard/boundingRect

JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy

Save to pass ·