# TextWidgetProps

Properties for a Text widget.

Used as props by: [TextWidget](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cloudwatch.TextWidget.html)

- Source: [`aws-cloudwatch/lib/text.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-cloudwatch/lib/text.ts#L20)
- Type last changed: v2.276.0 · 10 Nov 2026

## Example

TypeScript:

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

dashboard.addWidgets(new cloudwatch.TextWidget({
  markdown: '# Key Performance Indicators'
}));
```

Python:

```python
# dashboard: cloudwatch.Dashboard

dashboard.add_widgets(cloudwatch.TextWidget(
    markdown="# Key Performance Indicators"
))
```

Java:

```java
Dashboard dashboard;

dashboard.addWidgets(TextWidget.Builder.create()
        .markdown("# Key Performance Indicators")
        .build());
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
Dashboard dashboard;

dashboard.AddWidgets(new TextWidget(new TextWidgetProps {
    Markdown = "# Key Performance Indicators"
}));
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var dashboard Dashboard

dashboard.AddWidgets(cloudwatch.NewTextWidget(&TextWidgetProps{
	Markdown: jsii.String("# Key Performance Indicators"),
}))
```

## Properties

- `background`: [TextWidgetBackground](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cloudwatch.TextWidgetBackground.html) = TextWidgetBackground.TRANSPARENT — Background for the widget.

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

- `markdown`: string (required) — The text to display, in MarkDown format.

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