# SiWeatherWidgetBodyComponent documentation

**Kind:** component

**Selector:** `si-weather-widget-body`

```
import { SiWeatherWidgetBodyComponent } from '@siemens/element-ng/dashboard';
```

Body of the `<si-weather-widget>`. Useful for compositions that do not need the surrounding `<si-card>` chrome (e.g. embedding the weather inside a custom container).

Data is supplied as a composite [value](<index.html#SiWeatherWidgetBodyComponent.value>) payload of type [SiWeatherWidgetData](<index.html#t:SiWeatherWidgetData>).

The body delegates illustration resolution to the injected [SiWeatherIconResolver](<../../injectables/SiWeatherIconResolver/index.html#SiWeatherIconResolver>). The library ships a default resolver that maps the built-in [SiWeatherCondition](<../../types/SiWeatherCondition/index.html#t:SiWeatherCondition>) vocabulary to Element icons.

In the `vertical` layout the forecast list responsively hides additional data columns (wind, humidity, …) via pure CSS container queries when the widget becomes too narrow. See `si-weather-widget-body.component.scss` for the thresholds.

```
component SiWeatherWidgetBodyComponent extends SiWidgetBaseDirective<SiWeatherWidgetData>
```

#### Input Properties

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [disableAutoLoadingIndicator](<https://github.com/siemens/element/blob/main/projects/element-ng/dashboard/widgets/si-widget-base.directive.ts#L35-L35>) (inherited) | `boolean` | `false` | Option to disable automatic start of skeleton loading indication.<br><br>Inherited from `SiWidgetBaseDirective<SiWeatherWidgetData>` |
| [forecastLabel](<https://github.com/siemens/element/blob/main/projects/element-ng/dashboard/widgets/si-weather-widget/si-weather-widget-body.component.ts#L104-L106>) | `TranslatableString` | `` $localize`:@@SI_WEATHER_WIDGET.FORECAST_LABEL:Weather forecast` `` | Accessible label for the forecast section. |
| [initialLoadingIndicatorDebounceTime](<https://github.com/siemens/element/blob/main/projects/element-ng/dashboard/widgets/si-widget-base.directive.ts#L59-L59>) (inherited) | `number` | `300` | Initial delay time in milliseconds before enabling loading indicator. Only used once initially during construction.<br><br>Inherited from `SiWidgetBaseDirective<SiWeatherWidgetData>` |
| [layout](<https://github.com/siemens/element/blob/main/projects/element-ng/dashboard/widgets/si-weather-widget/si-weather-widget-body.component.ts#L78-L78>) | `SiWeatherWidgetLayout` | `'vertical'` | Visual layout. [SiWeatherWidgetLayout](<index.html#t:SiWeatherWidgetLayout>). |
| [location](<https://github.com/siemens/element/blob/main/projects/element-ng/dashboard/widgets/si-weather-widget/si-weather-widget-body.component.ts#L84-L84>) | `TranslatableString \| undefined` |  | Optional location label, shown inside the body in the compact layout only. The non-compact layouts render the location via the `<si-card>` heading managed by `SiWeatherWidgetComponent`. |
| [metricsLabel](<https://github.com/siemens/element/blob/main/projects/element-ng/dashboard/widgets/si-weather-widget/si-weather-widget-body.component.ts#L93-L95>) | `TranslatableString` | `` $localize`:@@SI_WEATHER_WIDGET.METRICS_LABEL:Additional weather data` `` | Accessible label for the additional data list. |
| [showLoadingIndicator](<https://github.com/siemens/element/blob/main/projects/element-ng/dashboard/widgets/si-widget-base.directive.ts#L41-L45>) (inherited) | `boolean` | `false` | Input to start and stop the skeleton loading indication.<br><br>Inherited from `SiWidgetBaseDirective<SiWeatherWidgetData>` |
| [value](<https://github.com/siemens/element/blob/main/projects/element-ng/dashboard/widgets/si-widget-base.directive.ts#L29-L29>) (required, inherited) | `SiWeatherWidgetData \| undefined` |  | The main value to be displayed. If no value is set, the skeleton indicates the loading of the value. Disable the automatic loading mechanism by setting `SiWidgetBodyBaseComponent.disableAutoLoadingIndicator`.<br><br>Inherited from `SiWidgetBaseDirective<SiWeatherWidgetData>` |

#### Attributes and Methods

##### showLoadingIndicator

[Source for showLoadingIndicator](<https://github.com/siemens/element/blob/main/projects/element-ng/dashboard/widgets/si-widget-base.directive.ts#L49-L51>)

**Modifiers:** readonly, inherited

**Type:** `Signal<boolean>`

**Default:** `...`

Inherited from `SiWidgetBaseDirective<SiWeatherWidgetData>`

### Types Documentation

### [SiWeatherWidgetData](<https://github.com/siemens/element/blob/main/projects/element-ng/dashboard/widgets/si-weather-widget/si-weather-widget.types.ts#L123-L127>)

**Kind:** interface

```
import type { SiWeatherWidgetData } from '@siemens/element-ng/dashboard';
```

Composite payload accepted by the body component. Granular widget/body inputs (`current`, `metrics`, `forecast`) take precedence when set.

```
interface SiWeatherWidgetData
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [current](<https://github.com/siemens/element/blob/main/projects/element-ng/dashboard/widgets/si-weather-widget/si-weather-widget.types.ts#L124-L124>) | `SiWeatherWidgetCurrent` |  |
| [forecast](<https://github.com/siemens/element/blob/main/projects/element-ng/dashboard/widgets/si-weather-widget/si-weather-widget.types.ts#L126-L126>) (optional) | `SiWeatherWidgetForecast` |  |
| [metrics](<https://github.com/siemens/element/blob/main/projects/element-ng/dashboard/widgets/si-weather-widget/si-weather-widget.types.ts#L125-L125>) (optional) | `readonly SiWeatherWidgetMetric[]` |  |

### [SiWeatherWidgetLayout](<https://github.com/siemens/element/blob/main/projects/element-ng/dashboard/widgets/si-weather-widget/si-weather-widget.types.ts#L17-L17>)

**Kind:** type alias

```
import type { SiWeatherWidgetLayout } from '@siemens/element-ng/dashboard';
```

Visual layout of the [SiWeatherWidgetComponent](<../SiWeatherWidgetComponent/index.html#SiWeatherWidgetComponent>).

• `vertical`: full vertical card layout with header, today block, optional additional data and an optional vertical forecast table.

• `horizontal`: wider card with the today block laid out side by side and a horizontal forecast strip below.

• `compact`: condensed card without a card header. Location and min/max temperature are rendered next to the illustration. Does not show a forecast.

```
type SiWeatherWidgetLayout = 'vertical' | 'horizontal' | 'compact'
```

### [TranslatableString](<https://github.com/siemens/element/blob/main/projects/element-translate-ng/translate-types/global.types.ts#L18-L18>)

**Kind:** type alias

```
import type { TranslatableString } from '@siemens/element-translate-ng/translate-types';
```

Represents a translatable string. This can either be a translation key, e.g. `ACTIONS.EDIT` that will be automatically translated when displayed on the UI or a pre-translated string, e.g. `Edit`. Equivalent to a normal string in usage and functionality.

```
type TranslatableString = string & Translatable
```

### [SiWeatherWidgetCurrent](<https://github.com/siemens/element/blob/main/projects/element-ng/dashboard/widgets/si-weather-widget/si-weather-widget.types.ts#L45-L58>)

**Kind:** interface

```
import type { SiWeatherWidgetCurrent } from '@siemens/element-ng/dashboard';
```

Today block of the weather widget.

```
interface SiWeatherWidgetCurrent
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [condition](<https://github.com/siemens/element/blob/main/projects/element-ng/dashboard/widgets/si-weather-widget/si-weather-widget.types.ts#L49-L49>) (optional) | `TranslatableString` | Translatable condition label, e.g. `"Sunny"`. |
| [illustration](<https://github.com/siemens/element/blob/main/projects/element-ng/dashboard/widgets/si-weather-widget/si-weather-widget.types.ts#L51-L51>) (optional) | `string \| SiWeatherIcon` | Weather illustration. A string is shorthand for `{ src }`. |
| [illustrationAlt](<https://github.com/siemens/element/blob/main/projects/element-ng/dashboard/widgets/si-weather-widget/si-weather-widget.types.ts#L53-L53>) (optional) | `TranslatableString` | Optional alt text used when [illustration](<index.html#t:SiWeatherWidgetCurrent.illustration>) is given as a string. |
| [maxTemperature](<https://github.com/siemens/element/blob/main/projects/element-ng/dashboard/widgets/si-weather-widget/si-weather-widget.types.ts#L57-L57>) (optional) | `string \| number` | Today's maximum temperature, pre-formatted by the caller. |
| [minTemperature](<https://github.com/siemens/element/blob/main/projects/element-ng/dashboard/widgets/si-weather-widget/si-weather-widget.types.ts#L55-L55>) (optional) | `string \| number` | Today's minimum temperature, pre-formatted by the caller. |
| [temperature](<https://github.com/siemens/element/blob/main/projects/element-ng/dashboard/widgets/si-weather-widget/si-weather-widget.types.ts#L47-L47>) | `string \| number` | Current temperature, pre-formatted by the caller (e.g. `"26°"` or `26`). |

### [SiWeatherWidgetMetric](<https://github.com/siemens/element/blob/main/projects/element-ng/dashboard/widgets/si-weather-widget/si-weather-widget.types.ts#L63-L68>)

**Kind:** interface

```
import type { SiWeatherWidgetMetric } from '@siemens/element-ng/dashboard';
```

A single metric row in the additional-data block (e.g. wind, precipitation).

```
interface SiWeatherWidgetMetric
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [label](<https://github.com/siemens/element/blob/main/projects/element-ng/dashboard/widgets/si-weather-widget/si-weather-widget.types.ts#L65-L65>) | `TranslatableString` | Translatable label, e.g. `"Wind"`. |
| [value](<https://github.com/siemens/element/blob/main/projects/element-ng/dashboard/widgets/si-weather-widget/si-weather-widget.types.ts#L67-L67>) | `string \| number` | Pre-formatted value, e.g. `"7km/h"`. |

### [SiWeatherWidgetForecast](<https://github.com/siemens/element/blob/main/projects/element-ng/dashboard/widgets/si-weather-widget/si-weather-widget.types.ts#L111-L117>)

**Kind:** interface

```
import type { SiWeatherWidgetForecast } from '@siemens/element-ng/dashboard';
```

Forecast block of the weather widget.

The vertical layout supports up to five optional [columns](<index.html#t:SiWeatherWidgetForecast.columns>) in addition to the mandatory rightmost min/max temperature column. The horizontal layout ignores [columns](<index.html#t:SiWeatherWidgetForecast.columns>) and renders only day label, illustration and min/max temperature per column. A horizontal forecast should provide at least three days for a visually balanced layout.

```
interface SiWeatherWidgetForecast
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [columns](<https://github.com/siemens/element/blob/main/projects/element-ng/dashboard/widgets/si-weather-widget/si-weather-widget.types.ts#L116-L116>) (optional) | `readonly SiWeatherWidgetForecastColumn[]` | Optional extra columns (vertical layout only). At most five are rendered. |
| [days](<https://github.com/siemens/element/blob/main/projects/element-ng/dashboard/widgets/si-weather-widget/si-weather-widget.types.ts#L113-L113>) | `readonly SiWeatherWidgetForecastDay[]` | The forecast days in display order. |

### [SiWeatherIcon](<https://github.com/siemens/element/blob/main/projects/element-ng/dashboard/widgets/si-weather-widget/si-weather-widget.types.ts#L33-L40>)

**Kind:** interface

```
import type { SiWeatherIcon } from '@siemens/element-ng/dashboard';
```

Describes how a weather illustration should be resolved. Callers can either provide a direct [SiWeatherIcon.src](<index.html#t:SiWeatherIcon.src>) or a semantic [SiWeatherIcon.condition](<index.html#t:SiWeatherIcon.condition>) token resolved by a [SiWeatherIconResolver](<../../injectables/SiWeatherIconResolver/index.html#SiWeatherIconResolver>).

```
interface SiWeatherIcon
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [alt](<https://github.com/siemens/element/blob/main/projects/element-ng/dashboard/widgets/si-weather-widget/si-weather-widget.types.ts#L39-L39>) (optional) | `TranslatableString` | Translatable alt text for accessibility. |
| [condition](<https://github.com/siemens/element/blob/main/projects/element-ng/dashboard/widgets/si-weather-widget/si-weather-widget.types.ts#L35-L35>) (optional) | `string` | Semantic condition token, used by the resolver. Apps with custom resolvers may pass any string. |
| [src](<https://github.com/siemens/element/blob/main/projects/element-ng/dashboard/widgets/si-weather-widget/si-weather-widget.types.ts#L37-L37>) (optional) | `string` | Direct URL/path. Wins over [condition](<index.html#t:SiWeatherIcon.condition>). |

### [SiWeatherWidgetForecastDay](<https://github.com/siemens/element/blob/main/projects/element-ng/dashboard/widgets/si-weather-widget/si-weather-widget.types.ts#L91-L100>)

**Kind:** interface

```
import type { SiWeatherWidgetForecastDay } from '@siemens/element-ng/dashboard';
```

A single day in the forecast block.

```
interface SiWeatherWidgetForecastDay
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [illustration](<https://github.com/siemens/element/blob/main/projects/element-ng/dashboard/widgets/si-weather-widget/si-weather-widget.types.ts#L95-L95>) (optional) | `string \| SiWeatherIcon` | Weather illustration for the day. A string is shorthand for `{ src }`. |
| [label](<https://github.com/siemens/element/blob/main/projects/element-ng/dashboard/widgets/si-weather-widget/si-weather-widget.types.ts#L93-L93>) | `TranslatableString` | Translatable day label, e.g. `"Mon"`. |
| [maxTemperature](<https://github.com/siemens/element/blob/main/projects/element-ng/dashboard/widgets/si-weather-widget/si-weather-widget.types.ts#L99-L99>) | `string \| number` | Maximum temperature, pre-formatted by the caller. |
| [minTemperature](<https://github.com/siemens/element/blob/main/projects/element-ng/dashboard/widgets/si-weather-widget/si-weather-widget.types.ts#L97-L97>) | `string \| number` | Minimum temperature, pre-formatted by the caller. |

### [SiWeatherWidgetForecastColumn](<https://github.com/siemens/element/blob/main/projects/element-ng/dashboard/widgets/si-weather-widget/si-weather-widget.types.ts#L76-L86>)

**Kind:** interface

```
import type { SiWeatherWidgetForecastColumn } from '@siemens/element-ng/dashboard';
```

An optional forecast column shown left of the temperature column in vertical layouts. The widget supports up to five of these columns; additional columns are ignored. The temperature column is mandatory and always rendered on the right; it does not need to be modelled as a column here.

```
interface SiWeatherWidgetForecastColumn
```

#### Properties

| Name | Type | Description |
| --- | --- | --- |
| [icon](<https://github.com/siemens/element/blob/main/projects/element-ng/dashboard/widgets/si-weather-widget/si-weather-widget.types.ts#L80-L80>) (optional) | `string` | element-icons icon name shown next to each row value. |
| [label](<https://github.com/siemens/element/blob/main/projects/element-ng/dashboard/widgets/si-weather-widget/si-weather-widget.types.ts#L78-L78>) (optional) | `TranslatableString` | Translatable column label, used as `aria-label` for the column. |
| [values](<https://github.com/siemens/element/blob/main/projects/element-ng/dashboard/widgets/si-weather-widget/si-weather-widget.types.ts#L85-L85>) | `readonly (string \| number \| undefined)[]` | Per-day values, aligned by index with [SiWeatherWidgetForecast.days](<index.html#t:SiWeatherWidgetForecast.days>). Missing entries are rendered as empty cells. |
