# header-action

## Overview

An `action` can be linked to a header cell, which will be triggered when a user clicks on the cell. In this case, the specified [`on-press`](#on-press) function will execute.

{% hint style="info" %}
**Note:** Unlike row and cell actions, this function does not have access to `$selection`, as they are only rendered once per column.
{% endhint %}

{% hint style="info" %}
See more information in the guide on `object-table` [actions](https://docs.journeyapps.com/reference/build/ui-components/all-ui-components/object-table/object-table-guides/actions).
{% endhint %}

### Basic Example

{% code title="main.view\.xml" %}

```xml
<object-table ...>
    <column heading="Name">
        <header-action icon="fa-angle-right" on-press="$:headerAction()" />
    </column>
</object-table>
```

{% endcode %}

## Standard Attributes

### `on-press`

See [`column` > `action` > `on-press`](https://docs.journeyapps.com/reference/build/ui-components/all-ui-components/object-table/action#on-press)

### `validate`

See [`column` > `action` > `validate`](https://docs.journeyapps.com/reference/build/ui-components/all-ui-components/object-table/action#validate)

## Advanced Attributes

### `icon`

See [`column` > `action` > `icon`](https://docs.journeyapps.com/reference/build/ui-components/all-ui-components/object-table/action#icon)
