+++
# -----------------------------------------------------------------------
# Do not edit this file. It is automatically generated by API Documenter.
# -----------------------------------------------------------------------
title = "measureText"
keywords = ["grafana","documentation","sdk","@grafana/ui"]
type = "docs"
+++

## measureText() function

### measureText() function

<b>Signature</b>

```typescript
export declare function measureText(text: string, fontSize: number): TextMetrics;
```
<b>Import</b>

```typescript
import { measureText } from '@grafana/ui';
```
<b>Parameters</b>

|  Parameter | Type | Description |
|  --- | --- | --- |
|  text | <code>string</code> |  |
|  fontSize | <code>number</code> |  |

<b>Returns:</b>

`TextMetrics`

