# MetricWidgetProps

Basic properties for widgets that display metrics.

- Source: [`aws-cloudwatch/lib/graph.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-cloudwatch/lib/graph.ts#L11)
- Type last changed: v2.203.0 · 1 Jul 2025

## Example

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_cloudwatch as cloudwatch } from 'aws-cdk-lib';
const metricWidgetProps: cloudwatch.MetricWidgetProps = {
  accountId: 'accountId',
  height: 123,
  region: 'region',
  title: 'title',
  width: 123,
};
```

## Properties

- `accountId`: string — The AWS account ID where the metrics are located.

  **Default:** Current account

  This enables cross-account functionality for CloudWatch dashboards.
  Before using this feature, ensure that proper cross-account sharing is configured
  between the monitoring account and source account.

  For more information, see:
  https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Unified-Cross-Account.html

- `height`: number — Height of the widget.

  **Default:** 6 for Alarm and Graph widgets. 3 for single value widgets where most recent value of a metric is displayed.

- `region`: string — The region the metrics of this graph should be taken from.

  **Default:** Current region

- `title`: string = None — Title for the graph.

- `width`: number = 6 — Width of the widget, in a grid of 24 units wide.
