--- group: path: /packages/interactive --- # getMenuButtonBoundingClientRect [](https://www.npmjs.com/package/@uni/navigation-bar) 解获取菜单按钮(右上角胶囊按钮)的布局位置信息。坐标信息以屏幕左上角为原点。
## 安装
```bash
$ npm install @uni/navigation-bar --save
```
or
```bash
$ npm install @uni/apis --save
```
## 示例
```javascript
import { getMenuButtonBoundingClientRect } from '@uni/navigation-bar';
getMenuButtonBoundingClientRect();
```
你也可以从大包引入:
```js
import { navigationBar } from '@uni/apis';
navigationBar.getMenuButtonBoundingClientRect();
```
## 方法
### `getMenuButtonBoundingClientRect()`
### 返回值
| 属性 | 类型 | 描述 |
| --- | --- | --- |
| width | `number` | 宽度,单位:px |
| height | `number` | 高度,单位:px |
| top | `number` | 上边界坐标,单位:px |
| right | `number` | 右边界坐标,单位:px |
| bottom | `number` | 下边界坐标,单位:px |
| left | `number` | 左边界坐标,单位:px |
### 不通用返回(由于破坏了一码多端的能力,不推荐使用)
| 属性 | 类型 | 描述 | 支持 |
| --- | --- | --- | ----|
| errMsg | `string` | |