# Feedback buttons element

Buttons to indicate positive or negative feedback, shown as a thumbs up and a thumbs down.

| | |
|---|---|
| **Type** | `feedback_buttons` |
| **Available in** | Messages |
| **Works in blocks** | [Context actions block](https://workstation.repzo.com/docs/developers/block-kit/blocks/context-actions-block) |

## Usage

Both `positive_button` and `negative_button` take these fields:

| Field | Type | Description | Required? |
|---|---|---|---|
| `text` | Text object | A `plain_text` text object that names the button. Maximum length for the `text` in this field is 75 characters. | Required |
| `value` | String | The value to send along with the interaction payload. Maximum length is 2000 characters. | Required |
| `accessibility_label` | String | A label read out by screen readers instead of `text`. Maximum length is 75 characters. | Optional |

Pressing one sends your app a `block_actions` payload whose `value` is the pressed button's `value`:

```json
{
  "type": "feedback_buttons",
  "action_id": "summary_feedback",
  "block_id": "pipeline_summary_feedback",
  "value": "summary_helpful",
  "action_ts": "1793786400.000000"
}
```

The pressed thumb stays highlighted for that reader. See the [button element](https://workstation.repzo.com/docs/developers/block-kit/elements/button-element) for the rest of the payload.

## Fields

| Field | Type | Description | Required? |
|---|---|---|---|
| `type` | String | The type of element. In this case `type` is always `feedback_buttons`. | Required |
| `positive_button` | Object | A button to indicate positive feedback. See the button fields above. | Required |
| `negative_button` | Object | A button to indicate negative feedback. See the button fields above. | Required |
| `action_id` | String | An identifier for the action triggered when one of the buttons is pressed. You can use this when you receive an interaction payload to identify the source of the action. Should be unique among all other `action_id`s in the containing block. Maximum length is 255 characters. If you leave it out, Repzo generates one. | Optional |

> **How Repzo Chat differs from Slack**
>
> - The buttons are drawn as thumbs-up and thumbs-down icons; each button's `text` is its tooltip and, without an `accessibility_label`, its screen-reader label.
> - The highlighted choice belongs to that reader's screen only: it clears when they reload or when the message is updated.

## Examples

### Feedback buttons under a reply

```json
{
  "blocks": [
    {
      "type": "section",
      "text": {
        "type": "mrkdwn",
        "text": "*Pipeline this week*\n• 14 open deals worth *$212,000*\n• 3 deals moved to *Negotiation*\n• 2 deals have had no activity for 14 days"
      }
    },
    {
      "type": "context_actions",
      "block_id": "pipeline_summary_feedback",
      "elements": [
        {
          "type": "feedback_buttons",
          "action_id": "summary_feedback",
          "positive_button": {
            "text": {
              "type": "plain_text",
              "text": "Helpful"
            },
            "value": "summary_helpful",
            "accessibility_label": "Mark this summary as helpful"
          },
          "negative_button": {
            "text": {
              "type": "plain_text",
              "text": "Not helpful"
            },
            "value": "summary_not_helpful",
            "accessibility_label": "Mark this summary as not helpful"
          }
        }
      ]
    }
  ]
}
```

## Related

- [Block elements](https://workstation.repzo.com/docs/developers/block-kit/elements)
- [Block Kit overview](https://workstation.repzo.com/docs/developers/block-kit)
