# TextWidget

A dashboard widget that displays MarkDown.

Extends: [ConcreteWidget](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cloudwatch.ConcreteWidget.html) › TextWidget
Implements: [IWidget](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_cloudwatch.IWidget.html)

- Source: [`aws-cloudwatch/lib/text.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0/packages/aws-cdk-lib/aws-cloudwatch/lib/text.ts#L51)

## 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"),
}))
```

## Initializer

TypeScript:

```ts
new TextWidget(props: TextWidgetProps)
```

Python:

```python
TextWidget(props: TextWidgetProps)
```

Java:

```java
new TextWidget(TextWidgetProps props)
```

C# / .NET:

```csharp
new TextWidget(TextWidgetProps props)
```

Golang:

```go
NewTextWidget(Props TextWidgetProps)
```

## Properties

- `height`: number — The amount of vertical grid units the widget will take up.

- `warnings`: string[] — Any warnings that are produced as a result of putting together this widget.

- `warningsV2`: { [key: string]: string } — Any warnings that are produced as a result of putting together this widget.

- `width`: number — The amount of horizontal grid units the widget will take up.

## Methods

- `position(x: number, y: number): void` — Place the widget at a given position.

- `toJson(): any[]` — Return the widget JSON for use in the dashboard.
