# Summary chip

**Summary chips** are compact components designed to quickly and concisely summarize data. They are often used to provide a condensed overview, summarize states, and allow for filtering of information in a visually appealing manner.

## Usage

![Summary chip](<../images/summary-chip.png>)

There are basically two main use cases for the summary chip component:

- **State indication**: To show values of different categories, such as `Override`, `Success`, `Issue`, `Not tested`, etc.
- **Filtering**: To filter datasets or information based on the specific categories.

### When to use

Arrange one or more Summary Chips in a horizontal layout above or near the related content. Chips can be combined with other supporting elements, such as badges, buttons, or links, to enhance functionality. Place them within a container that can use a background of `None`, `background-0`, or `background-1`, depending on the visual requirements.

![Summary chip example](<../images/summary-chip-example.png>)

## Design

### Elements

![Summary chip construction](<../images/summary-chip-usage-construction.png>)

> 1. Category icon or composite icon (optional), 2. Label (optional), 3. Value (optional)

The summary chip can hold an icon or a composite icon representing a state. The icon must be self-explanatory since there is no label.

### States

![Summary chip states](<../images/summary-chip-usage-states.png>)

### Variants

The component is very flexible, hence allowing the following variants:

![Summary chip variants](<../images/summary-chip-usage-variants.png>)

## Code

#### Example

Component:

```typescript
/**
 * Copyright (c) Siemens 2016 - 2026
 * SPDX-License-Identifier: MIT
 */
import { NgTemplateOutlet } from '@angular/common';
import { Component } from '@angular/core';
import { SiSummaryChipComponent } from '@siemens/element-ng/summary-chip';

@Component({
  selector: 'app-sample',
  imports: [NgTemplateOutlet, SiSummaryChipComponent],
  templateUrl: './si-summary-chip.html'
})
export class SampleComponent {}
```

Template:

```html
<div class="d-flex gap-4 p-5 background-0">
  <ng-container [ngTemplateOutlet]="chips" />
</div>
<div class="d-flex gap-4 p-5 background-1">
  <ng-container [ngTemplateOutlet]="chips" />
</div>

<ng-template #chips>
  <si-summary-chip
    icon="element-manual-filled"
    color="status-warning"
    label="Override"
    value="128"
  />
  <si-summary-chip status="success" label="Success" value="128" hideLabel [selected]="true" />
  <si-summary-chip status="danger" label="Danger" value="32" />
  <si-summary-chip status="caution" label="Caution" value="42" disabled />
  <si-summary-chip icon="element-not-checked" label="Override" />
  <si-summary-chip label="Label" value="Value" />
  <si-summary-chip label="Warning" />
</ng-template>
```

### [SiSummaryChipComponent](<https://github.com/siemens/element/blob/main/projects/element-ng/summary-chip/si-summary-chip.component.ts#L16-L65>)

**Kind:** component

**Selector:** `si-summary-chip`

```
import { SiSummaryChipComponent } from '@siemens/element-ng/summary-chip';
```

```
component SiSummaryChipComponent
```

#### Input Properties

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| [color](<https://github.com/siemens/element/blob/main/projects/element-ng/summary-chip/si-summary-chip.component.ts#L23-L23>) | `string \| undefined` |  | Color class, see [https://element.siemens.io/typography/\#color-variants-classes](<https://element.siemens.io/typography/#color-variants-classes>). |
| [disabled](<https://github.com/siemens/element/blob/main/projects/element-ng/summary-chip/si-summary-chip.component.ts#L41-L41>) | `boolean` | `false` | Disabled state. |
| [hideLabel](<https://github.com/siemens/element/blob/main/projects/element-ng/summary-chip/si-summary-chip.component.ts#L46-L46>) | `boolean` | `false` | Whether to hide the label. Only takes effect when both [icon](<index.html#SiSummaryChipComponent.icon>) and [value](<index.html#SiSummaryChipComponent.value>) are provided. The label will still be used for screen-readers. |
| [icon](<https://github.com/siemens/element/blob/main/projects/element-ng/summary-chip/si-summary-chip.component.ts#L21-L21>) | `string \| undefined` |  | Icon token, see [https://element.siemens.io/icons/element](<https://element.siemens.io/icons/element>). |
| [label](<https://github.com/siemens/element/blob/main/projects/element-ng/summary-chip/si-summary-chip.component.ts#L29-L29>) (required) | `TranslatableString` |  | The label. |
| [selected](<https://github.com/siemens/element/blob/main/projects/element-ng/summary-chip/si-summary-chip.component.ts#L36-L36>) | `boolean` | `false` | Selected state, will change when clicked. |
| [stackedColor](<https://github.com/siemens/element/blob/main/projects/element-ng/summary-chip/si-summary-chip.component.ts#L27-L27>) | `string \| undefined` |  | Color class, see [https://element.siemens.io/fundamentals/icons/](<https://element.siemens.io/fundamentals/icons/>). |
| [stackedIcon](<https://github.com/siemens/element/blob/main/projects/element-ng/summary-chip/si-summary-chip.component.ts#L25-L25>) | `string \| undefined` |  | Icon token, see [https://element.siemens.io/fundamentals/icons/](<https://element.siemens.io/fundamentals/icons/>). |
| [status](<https://github.com/siemens/element/blob/main/projects/element-ng/summary-chip/si-summary-chip.component.ts#L19-L19>) | `ExtendedStatusType \| undefined` |  | Status. Alternatively, use [icon](<index.html#SiSummaryChipComponent.icon>) and [color](<index.html#SiSummaryChipComponent.color>). |
| [value](<https://github.com/siemens/element/blob/main/projects/element-ng/summary-chip/si-summary-chip.component.ts#L31-L31>) | `TranslatableString \| undefined` |  | Value to display. |

#### Output Properties

| Name | Type | Description |
| --- | --- | --- |
| [selectedChange](<https://github.com/siemens/element/blob/main/projects/element-ng/summary-chip/si-summary-chip.component.ts#L36-L36>) | `boolean` | Selected state, will change when clicked. |

### Types Documentation

### [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'
```

### [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
```

### [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'
```
