---
title: "Head to Head Button"
canonical_url: "https://docs.sportradar.com/resources/widgets/docs/head-to-head/button"
markdown_url: "https://docs.sportradar.com/resources/widgets/docs/head-to-head/button.md"
last_updated: "2026-10-08T07:31:12Z"
---

# Head to Head Button

**Head to Head Button** widget displays a compact button that, when clicked, opens a popover containing comprehensive pre-match and live match statistics, head-to-head records, team form, and game momentum data. The widget provides an unobtrusive way to present rich statistical analysis without consuming permanent page space, making it ideal for match pages, live score tickers, or event listings where detailed statistics need to be available on demand. The popover features two distinct layouts: *overlay layout* where all statistics are displayed in a single- or two-column display (based on available width), and *inline layout* with fixed popover height and tabbed navigation.

![Head To Head Button Default](https://docs.sportradar.com/resources/widgets/static/img/headtohead/h2h_button_overlay_carousel.png)

Head To Head Button Default

![Head To Head Button Game Pulse](https://docs.sportradar.com/resources/widgets/static/img/headtohead/h2h_button_inline_carousel.png)

Head To Head Button Game Pulse

![Head To Head Button Custom Label and Icon](https://docs.sportradar.com/resources/widgets/static/img/headtohead/h2h_button_custom_label_carousel.png)

Head To Head Button Custom Label and Icon

See the [Head To Head Button widget demo](https://widgets.sir.sportradar.com/head-to-head).

## Supported Content and Environment

### Required Parameters

**Required identifiers:**

- **widget-name**: `headToHead.button`
- **matchId**: The Sportradar match identifier. See [Getting Identifiers](https://docs.sportradar.com/resources/widgets/docs/tutorials/getting-identifiers.md)

**Environment Requirements**

## Technical Requirements:

- JavaScript enabled
- XMLHttpRequest support for data fetching
- CSS3 support for styling and animations

**Supported Sports**

| Sport             | Sport ID |
| ----------------- | -------- |
| Soccer            | 1        |
| Basketball        | 2        |
| Baseball          | 3        |
| Ice Hockey        | 4        |
| Tennis            | 5        |
| Handball          | 6        |
| Rugby             | 12       |
| Aussie Rules      | 13       |
| Football          | 16       |
| Snooker           | 19       |
| Table Tennis      | 20       |
| Cricket           | 21       |
| Darts             | 22       |
| Volleyball        | 23       |
| Waterpolo         | 26       |
| Futsal            | 29       |
| Badminton         | 31       |
| Beach Volley      | 34       |
| Squash            | 37       |
| Beach Soccer      | 60       |
| Pesapallo         | 61       |
| Esport Soccer     | 137      |
| Esport Basketball | 153      |
| Esport Ice Hockey | 195      |

## Main Configurable Features

The widget offers several display modes and content customization options.

**Default Button**

![Head To Head Button Default](https://docs.sportradar.com/resources/widgets/static/img/headtohead/h2h_button_overlay.png)

**Configuration:**

```javascript
{
    layout: "overlay"  // Default
}
```

Button opens a floating popover overlay. Ideal for compact spaces where statistics should appear on-demand.

**Game Pulse Button**

![Head To Head Button Game Pulse](https://docs.sportradar.com/resources/widgets/static/img/headtohead/h2h_button_inline.png)

**Configuration:**

```javascript
{
    layout: "inline"
}
```

Button opens a floating popover with H2H inline layout featuring fixed popover height and tabbed navigation.

**Custom Button Label and Icon**

![Head To Head Custom Label and Icon](https://docs.sportradar.com/resources/widgets/static/img/headtohead/h2h_button_custom_label.png)

**Configuration:**

```javascript
{
    label: "Match Stats",
    icon: "https://example.com/stats-icon.png"
}
```

Customize button text and icon to match your design.

See the [Head To Head Button demo](https://widgets.sir.sportradar.com/head-to-head) for live examples.

## API Reference

| Property                      | Type                | Required | Default                                               | Description                                                                                                                                                                                                                                                  |
| ----------------------------- | ------------------- | -------- | ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `matchId`                     | `number`            | **Yes**  | -                                                     | Sportradar match identifier. See [Getting Identifiers](https://docs.sportradar.com/resources/widgets/docs/tutorials/getting-identifiers.md)                                                                                                                  |
| `position`                    | `string`            | No       | `"right"`                                             | Popover position relative to button. <ul><li>`"left"`: Popover opens to the left of button</li><li>`"right"`: Popover opens to the right of button</li><li>`"bottom"`: Popover opens below button</li></ul> Position automatically adjusts for RTL languages |
| `width`                       | `number`            | No       | `320`                                                 | Width of popover in pixels. Recommended range: 280-600. Popover has max-width of 90% viewport width                                                                                                                                                          |
| `layout`                      | `string`            | No       | `"overlay"`                                           | Display mode for statistics content within the popover. <ul><li>`"overlay"`: Responsive layout, two columns when width exceeds 580px, single column below</li><li>`"inline"`: Layout with fixed height and with tabbed navigation.</li></ul>                 |
| `label`                       | `string`            | No       | `"Head to Head"`                                      | Text display next to the button. Also acts as a click trigger.                                                                                                                                                                                               |
| `icon`                        | `string`            | No       | Default icon                                          | URL of custom icon image to display on button. Ignored when `gamePulseBtnEnable` is true and match is live                                                                                                                                                   |
| `gamePulseBtnEnable`          | `boolean`           | No       | `false`                                               | Replace button icon with Game Pulse indicator during live matches. Shows match intensity visually on button                                                                                                                                                  |
| `gamePulseBtnVersion`         | `number`            | No       | `1`                                                   | Version of Game Pulse button indicator design.<br>Options: `1`, `2`, `3`.<br><br>See [Game Pulse Icons](#game-pulse-icons) for more information.                                                                                                             |
| `gamePulseBtnTooltip`         | `boolean`           | No       | `false`                                               | When `true`, hover over button icon will display tooltip with Game Pulse content.                                                                                                                                                                            |
| `btnBaseClass`                | `string`            | No       | -                                                     | CSS class for button styling. Controls button background and text colors                                                                                                                                                                                     |
| `themingClsName`              | `string`            | No       | -                                                     | Additional CSS class applied to popover container for custom theming                                                                                                                                                                                         |
| `disableScoreboard`           | `boolean`           | No       | `false`                                               | When `true`, hides the scoreboard tab. Useful when match score is displayed separately on the page                                                                                                                                                           |
| `showLastMeetings`            | `boolean`           | No       | `false`                                               | Display last meetings section in head-to-head tab with detailed match history                                                                                                                                                                                |
| `showSimpleForm`              | `boolean`           | No       | `false`                                               | Use simplified team form display instead of detailed match-by-match results. Shows win/draw/loss indicators only                                                                                                                                             |
| `showGamePulse`               | `boolean`           | No       | `true`                                                | Include Game Pulse momentum tab in statistics. When `false`, Game Pulse tab is hidden                                                                                                                                                                        |
| `gamePulseIconSet`            | `object`            | No       | See [Game Pulse Icos](#game-pulse-icons)              | Used to set custom match pulse icons. Value for each icon should contain URL pointing to the desired icon.                                                                                                                                                   |
| `statisticsEnableMatchStats`  | `boolean`           | No       | `true`                                                | Enable match-specific statistics tabs. When `false`, hides match-level statistical comparisons                                                                                                                                                               |
| `statisticsEnableSeasonStats` | `boolean`           | No       | `true`                                                | Enable season statistics tabs. When `false`, hides season-level team statistics                                                                                                                                                                              |
| `components`                  | `object` \| `array` | No       | See [Components identifiers](#components-identifiers) | Configuration object defining which components to display and their order.                                                                                                                                                                                   |
| `customOnClick`               | `function`          | No       | -                                                     | Custom click handler function. When provided, overrides default popover open/close behavior. Receives click event as parameter                                                                                                                               |
| `s5ClientAlias`               | `string`            | No       | -                                                     | S5 client alias to be used for direct link to additional statistics (on S5 solution). Required for "More Stats" button to function.                                                                                                                          |
| `enableShowMore`              | `boolean`           | No       | `false`                                               | When `true`, displays the "More Stats" button that links to detailed statistics on the S5 Statistics Centre.                                                                                                                                                 |

### Game Pulse Icons

Head to Head is available with three icons sets by default.

**Game Pulse Button Version 1 (Default)**

![H2H Game Pulse Button Version 1](https://docs.sportradar.com/resources/widgets/static/img/headtohead/h2h_button_icon_1.png)

**Configuration:**

```javascript
{
    gamePulseBtnVersion: 1
}
```

**Game Pulse Button Version 2**

![H2H Game Pulse Button Version 2](https://docs.sportradar.com/resources/widgets/static/img/headtohead/h2h_button_icon_2.png)

**Configuration:**

```javascript
{
    gamePulseBtnVersion: 2
}
```

**Game Pulse Button Version 3**

![H2H Game Pulse Button Version 3](https://docs.sportradar.com/resources/widgets/static/img/headtohead/h2h_button_icon_3.png)

**Configuration:**

```javascript
{
    gamePulseBtnVersion: 3
}
```

**Custom Game Pulse Icon set**

`gamePulseIconSet` option is available to override the style of Game Pulse icons.

**Configuration:**

```javascript
gamePulseIconSet: {
    veryLow: "https://example.com/icons/pulse-very-low.svg",
    low: "https://example.com/icons/pulse-low.svg",
    medium: "https://example.com/icons/pulse-medium.svg",
    high: "https://example.com/icons/pulse-high.svg",
    veryHigh: "https://example.com/icons/pulse-very-high.svg"
}
```

> **Note**
>
> All five intensity levels must be provided when using custom icon set. Icons are used in Game Pulse visualization to indicate match intensity.

### Components Identifiers

`components` property is an object with sport IDs as keys and arrays of strings (tab identifiers) as values.

```javascript
{
  default: ["headtohead", "form", "teamstats", "lastmatches"],
  1: ["gamepulse", "headtohead", "form", "teamstats", "teamstatsmatch", "lastmatches"], // soccer
  2: ["headtohead", "form", "teamstats", "lastmatches"], // basket
  3: ["headtohead", "form", "teamstats", "lastmatches"], // baseball
  4: ["headtohead", "form", "teamstats", "lastmatches"], // ice hockey
  5: ["headtohead", "form", "teamstats", "lastmatches"], // tennis
  6: ["headtohead", "form", "teamstats", "lastmatches"], // handball
  12: ["headtohead", "form", "lastmatches"], // rugby
  13: ["headtohead", "form", "teamstats", "lastmatches"], // aussie rules
  16: ["headtohead", "form", "lastmatches"], // american football
  19: ["headtohead", "teamstats", "lastmatches"], // snooker
  20: ["headtohead", "lastmatches"], // table tennis
  21: ["headtohead", "form", "teamstats", "lastmatches"], // cricket
  22: ["headtohead", "form", "teamstats", "lastmatches"], // darts
  23: ["headtohead", "form", "lastmatches"], // volleyball
  26: ["headtohead", "form", "teamstats", "lastmatches"], // waterpolo
  29: ["headtohead", "form", "teamstats", "lastmatches"], // futsal
  31: ["headtohead", "lastmatches"], // badminton
  34: ["headtohead", "form", "lastmatches"], // beach volleyball
  37: ["headtohead", "lastmatches"], // squash
  60: ["headtohead", "form", "lastmatches"], // beach soccer
  61: ["headtohead", "form", "teamstats", "lastmatches"], // pesapallo
  137: ["headtohead", "form", "teamstats", "lastmatches"], // esport: E-soccer
  153: ["headtohead", "lastmatches"], // esport: E-basketball
  195: ["headtohead", "lastmatches"], // esport: E-ice hockey
}
```

For every sport you can:

- re-order components/tabs by changing order of strings in array,
- disable components/tabs by removing specific strings from array

> **Tip**
>
> Scoreboard component/tab is always positioned first and can not be re-ordered. Additionally, scoreboard component/tab can not be removed using `components` property. Use `disableScoreboard` property instead to remove scoreboard.

> **Note**
>
> Invalid component IDs are automatically filtered out.

#### Examples

**Simplified notation**

To set same config for all sports, the simplified notation can be used:

```javascript
components: ['headtohead', 'form', 'teamstats', 'lastmatches']
```

**Full object notation**

To only display Head to Head and Last matches for soccer and Form and Team stats for basketball, the following configuration can be set:

```javascript
components: {
  1: ['headtohead', 'lastmatches'], // soccer
  2: ['form', 'teamstats'] // basketball
}
```

See [Head to Head Custom Components Order Guide](https://docs.sportradar.com/resources/widgets/docs/tutorials/widget-specific/example-h2h-components-reorder.md) for detailed examples.

## Integration Examples

### Property Name Transformations

Properties do not always transfer from the above table directly into integration code. Properties must be transformed differently for each integration method:

#### JavaScript/Programmatic Integration

- Property names remain unchanged in camelCase
- Properties become members of the 4th parameter object in `SIR()` call
- Example: `cardVariant: "compact"`

> **Info**
>
> In javascript integration, the properties go into an object which is passed as the 4th argument of the call ti `SIR()` function. Please see  [Global SIR API](https://docs.sportradar.com/resources/widgets/docs/tutorials/SIR.md)

#### HTML/Declarative Integration

- Convert camelCase to lowercase with dashes, e.g. cardVariant becomes card-variant
- Add `data-sr-` prefix
- Example: `cardVariant` → `data-sr-card-variant`
- Example: `filters.sport.hidden` → Complex objects must be passed as JSON strings

> **Info**
>
> In HTML integration, the properties go into the parent HTML object as object properties, prefixed with `data-sr-` as explained above.

> **Only base property support**
>
> This method supports only simple (base) properties and does not support properties that require functions.

> **Info**
>
> In all examples replace `sportradar` in the widgetloader URL path with your clientId.
>
> Example if your clientId is `client1`:
>
> - This URL: `https://widgets.sir.sportradar.com/sportradar/widgetloader`
> - becomes: `https://widgets.sir.sportradar.com/client1/widgetloader`

### JavaScript (Programmatic)

Initialize the widget programmatically using the JavaScript API. The widget renders in the specified container element.

**Overlay Layout**

```javascript
(function(a,b,c,d,e,f,g,h,i){a[e]||(i=a[e]=function(){(a[e].q=a[e].q||[]).push(arguments)},i.l=1*new Date,i.o=f,
g=b.createElement(c),h=b.getElementsByTagName(c)[0],g.async=1,g.src=d,g.setAttribute("n",e),h.parentNode.insertBefore(g,h)
)})(window,document,"script","https://widgets.sir.sportradar.com/sportradar/widgetloader","SIR", {
    language: 'en'
});

// Use PREMATCH match ID
SIR('addWidget', '#sr-widget', 'headToHead.button', {
    matchId: 67681902,
    layout: 'overlay'
});
```

```html
<div id="sr-widget"></div>
```

**Inline Layout**

```javascript
(function(a,b,c,d,e,f,g,h,i){a[e]||(i=a[e]=function(){(a[e].q=a[e].q||[]).push(arguments)},i.l=1*new Date,i.o=f,
g=b.createElement(c),h=b.getElementsByTagName(c)[0],g.async=1,g.src=d,g.setAttribute("n",e),h.parentNode.insertBefore(g,h)
)})(window,document,"script","https://widgets.sir.sportradar.com/sportradar/widgetloader","SIR", {
    language: 'en'
});

SIR('addWidget', '#sr-widget', 'headToHead.button', {
    matchId: 67681902,
    layout: 'inline'
});
```

```html
<div id="sr-widget"></div>
```

**Custom Components Order**

```javascript
(function(a,b,c,d,e,f,g,h,i){a[e]||(i=a[e]=function(){(a[e].q=a[e].q||[]).push(arguments)},i.l=1*new Date,i.o=f,
g=b.createElement(c),h=b.getElementsByTagName(c)[0],g.async=1,g.src=d,g.setAttribute("n",e),h.parentNode.insertBefore(g,h)
)})(window,document,"script","https://widgets.sir.sportradar.com/sportradar/widgetloader","SIR", {
    language: 'en'
});

SIR('addWidget', '#sr-widget', 'headToHead.button', {
    matchId: 67681902,
    layout: 'overlay',
    components: {
      1: ['headtohead', 'lastmatches'], // soccer
      2: ['form', 'teamstats'] // basketball
    }
});
```

```html
<div id="sr-widget"></div>
```

**Custom Button Label and Icon**

```javascript
(function(a,b,c,d,e,f,g,h,i){a[e]||(i=a[e]=function(){(a[e].q=a[e].q||[]).push(arguments)},i.l=1*new Date,i.o=f,
g=b.createElement(c),h=b.getElementsByTagName(c)[0],g.async=1,g.src=d,g.setAttribute("n",e),h.parentNode.insertBefore(g,h)
)})(window,document,"script","https://widgets.sir.sportradar.com/sportradar/widgetloader","SIR", {
    language: 'en'
});

SIR('addWidget', '#sr-widget', 'headToHead.button', {
    matchId: 67681902,
    label: "Match Stats",
    icon: "https://example.com/stats-icon.png"
});
```

```html
<div id="sr-widget"></div>
```

### HTML (Declarative)

Insert the following HTML code at the target widget location.

> **Note**
>
> **Important:** Callback functions (`customOnClick`) cannot be set via HTML attributes. Use JavaScript/Programmatic integration for these features.

**Overlay Layout**

```html
<div id="sr-widget"
     data-sr-widget="headToHead.button"
     data-sr-match-id="123"
     data-sr-layout="overlay">
</div>
<script type="application/javascript"
        src="https://widgets.sir.sportradar.com/sportradar/widgetloader"
        async>
</script>
```

**Inline Layout**

```html
<div id="sr-widget"
     data-sr-widget="headToHead.button"
     data-sr-match-id="123"
     data-sr-layout="inline">
</div>
<script type="application/javascript"
        src="https://widgets.sir.sportradar.com/sportradar/widgetloader"
        async>
</script>
```

**Custom Components Order**

```html
<div id="sr-widget"
     data-sr-widget="headToHead.button"
     data-sr-match-id="123"
     data-sr-layout="overlay"
     data-sr-tabs='{"1":["headtohead","lastmatches"],"2":["form","teamstats"]}'>
</div>
<script type="application/javascript"
        src="https://widgets.sir.sportradar.com/sportradar/widgetloader"
        async>
</script>
```

**Custom Button Label and Icon**

```html
<div id="sr-widget"
     data-sr-widget="headToHead.button"
     data-sr-match-id="123"
     data-sr-label="Match Stats"
     data-sr-icon="https://example.com/stats-icon.png">
</div>
<script type="application/javascript"
        src="https://widgets.sir.sportradar.com/sportradar/widgetloader"
        async>
</script>
```
