# Status counter

The **status counter** component (formerly **icon status**) represents a customizable icon with a counter.

## Code

### Usage

```
import { SiStatusCounterComponent } from '@siemens/element-ng/status-counter';

@Component({
  imports: [SiStatusCounterComponent, ...]
})
```

> [!NOTE]
>
> **Stacked icons**
>
> When using stacked icons we recommend using the composite icons to create harmonious icons.

#### Example

##### Status Counter

Component:

```typescript
/**
 * Copyright (c) Siemens 2016 - 2026
 * SPDX-License-Identifier: MIT
 */
import { Component } from '@angular/core';
import { SiStatusCounterComponent } from '@siemens/element-ng/status-counter';

@Component({
  selector: 'app-sample',
  imports: [SiStatusCounterComponent],
  templateUrl: './si-status-counter.html',
  host: { class: 'p-5' }
})
export class SampleComponent {}
```

Template:

```html
<si-status-counter class="mb-5" icon="element-plant" [count]="5" />
<si-status-counter
  class="mb-5"
  icon="element-circle-filled"
  stackedIcon="element-state-tick"
  color="status-success"
  [count]="2"
/>
<si-status-counter
  class="mb-5"
  icon="element-square-filled"
  stackedIcon="element-state-info"
  color="status-info"
  [count]="6"
  [disabled]="true"
/>
<si-status-counter
  class="mb-5"
  icon="element-triangle-filled"
  stackedIcon="element-state-exclamation-mark"
  color="status-warning"
  [count]="2"
/>
<si-status-counter
  class="mb-5"
  icon="element-circle-filled"
  stackedIcon="element-state-progress"
  color="status-info"
  [count]="4"
/>
<si-status-counter
  class="mb-5"
  icon="element-circle-filled"
  stackedIcon="element-state-pause"
  color="status-caution"
/>
<si-status-counter
  icon="element-octagon-filled"
  stackedIcon="element-state-exclamation-mark"
  color="status-critical"
  [count]="3"
/>
```

### [SiStatusCounterComponent](<https://github.com/siemens/element/blob/main/projects/element-ng/status-counter/si-status-counter.component.ts#L14-L35>)

**Kind:** component

**Selector:** `si-status-counter`

```
import { SiStatusCounterComponent } from '@siemens/element-ng/status-counter';
```

```
component SiStatusCounterComponent
```

#### Input Properties

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [color](<https://github.com/siemens/element/blob/main/projects/element-ng/status-counter/si-status-counter.component.ts#L26-L26>) | `string \| undefined` |  | Color of the icon |
| [count](<https://github.com/siemens/element/blob/main/projects/element-ng/status-counter/si-status-counter.component.ts#L24-L24>) | `number` | `0` | Counter below the icon |
| [disabled](<https://github.com/siemens/element/blob/main/projects/element-ng/status-counter/si-status-counter.component.ts#L32-L32>) | `boolean` | `false` | Whether the icon is disabled. |
| [icon](<https://github.com/siemens/element/blob/main/projects/element-ng/status-counter/si-status-counter.component.ts#L16-L16>) (required) | `string` |  | Icon to display. |
| [stackedIcon](<https://github.com/siemens/element/blob/main/projects/element-ng/status-counter/si-status-counter.component.ts#L18-L18>) | `string \| undefined` |  | Stacked icon to display. |

#### Attributes and Methods

##### isDisabledOrCountZero

[Source for isDisabledOrCountZero](<https://github.com/siemens/element/blob/main/projects/element-ng/status-counter/si-status-counter.component.ts#L34-L34>)

**Modifiers:** readonly

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

**Default:** `computed(() => !!this.disabled() || this.count() === 0)`

### [SiStatusIconComponent](<https://github.com/siemens/element/blob/main/projects/element-ng/icon/si-status-icon.component.ts#L25-L32>)

**Kind:** component

**Selector:** `si-status-icon`

```
import { SiStatusIconComponent } from '@siemens/element-ng/icon';
```

```
component SiStatusIconComponent
```

#### Input Properties

| Name | Type | Description |
| --- | --- | --- |
| [status](<https://github.com/siemens/element/blob/main/projects/element-ng/icon/si-status-icon.component.ts#L29-L29>) (required) | `EntityStatusType` | Status that determines the rendered stacked icon and accessible label. |

### Types Documentation

### [EntityStatusType](<https://github.com/siemens/element/blob/main/projects/element-ng/common/models/status-type.model.ts#L9-L9>)

**Kind:** type alias

```
import type { EntityStatusType } from '@siemens/element-ng/common';
```

```
type EntityStatusType = ExtendedStatusType | 'pending' | 'progress'
```

### [ExtendedStatusType](<https://github.com/siemens/element/blob/main/projects/element-ng/common/models/status-type.model.ts#L8-L8>)

**Kind:** type alias

```
import type { ExtendedStatusType } from '@siemens/element-ng/common';
```

```
type ExtendedStatusType = StatusType | 'unknown'
```

### [StatusType](<https://github.com/siemens/element/blob/main/projects/element-ng/common/models/status-type.model.ts#L7-L7>)

**Kind:** type alias

```
import type { StatusType } from '@siemens/element-ng/common';
```

```
type StatusType = 'success' | 'info' | 'warning' | 'danger' | 'caution' | 'critical'
```
