# CustomWidgetProps

The properties for a CustomWidget.

Extends: CustomWidgetProps
Used as props by: CustomWidget

- Source: [`aws-cloudwatch/lib/graph.ts`](https://github.com/aws/aws-cdk/blob/v2.274.0/packages/aws-cdk-lib/aws-cloudwatch/lib/graph.ts#L953)
- Type last changed: v2.23.0 · 4 May 2022

## Example

```ts
declare const dashboard: cloudwatch.Dashboard;

// Import or create a lambda function
const fn = lambda.Function.fromFunctionArn(
  dashboard,
  'Function',
  'arn:aws:lambda:us-east-1:123456789012:function:MyFn',
);

dashboard.addWidgets(new cloudwatch.CustomWidget({
  functionArn: fn.functionArn,
  title: 'My lambda baked widget',
}));
```

## Properties

- `functionArn`: string (required) — The Arn of the AWS Lambda function that returns HTML or JSON that will be displayed in the widget.

- `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.

- `params`: any — Parameters passed to the lambda function.

  **Default:** no parameters are passed to the lambda function

- `title`: string (required) — The title of the widget.

- `updateOnRefresh`: boolean = true — Update the widget on refresh.

- `updateOnResize`: boolean = true — Update the widget on resize.

- `updateOnTimeRangeChange`: boolean = true — Update the widget on time range change.

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