# [Usage](../../../../usage.md) > [Components](../../basics.md) > [Visuals](../../basics.md) > [Table](../table.md) > buttons

### `buttons` | `->setButtons([])`
Useful to set buttons for each rows. Those buttons can also handle `Closure` and each receive the `$record`, `$query` and `$originalQuery` as callback, so it can be used to do manipulations.

- `$record`: the actual record of the table row clicked, gotten from the query.
- `$query`: the filtered query, excluded pagination.
- `$originalQuery`: the original, unfiltered query, to do manipulations.
- `$customFilters`: the array of the custom filter form.

Example:

```php
->setButtons([
          \KFramework\Components\Visual\ButtonsGroup::make('Actions')
              ->setPreIcon('cog')
              ->setSchema(function ($record) {
                  return [
                      \KFramework\Components\Visual\Button::make('Open modal containing the record id')
                          ->setModal(function ($record) {
                              return \KFramework\Components\Visual\Modal::make()
                                      ->setContent($record->id);
                          })
                          ->setType('badge')
                  ];
              })
      ])
```

| Types   | Default |
|---------|---------|
| `array` | `[]`    |

What it does: adds a per-row action column. Requires a dynamic table (`setQuery()`), because each button closure receives the Eloquent `$record` for that row plus the filtered `$query`, the `$originalQuery`, `$customFilters` and `$search` (see `TableHelper::formatData()`). Buttons are HMAC-signed per record, so actions are tamper-safe.

Minimal working example — Blade:
```php
{!!
    \KFramework\Components\Visual\Table::make()
        ->setSchema([
            \KFramework\Components\Visual\TableColumn::make('name')->setLabel('Name'),
        ])
        ->setQuery($usersQuery)
        ->setButtons([
            \KFramework\Components\Visual\Button::make('Open')
                ->setModal(fn ($record) => \KFramework\Components\Visual\Modal::make()->setContent($record->id))
                ->setType('badge'),
        ])
!!}
```
Controller: same, with `Table::`, `TableColumn::`, `Button::` facades and the `ButtonsGroup` example already shown above.

What the user sees: an extra right-hand column with the buttons/groups for every row (e.g. an "Actions" dropdown per record).

Interaction:
- Requires [query](table_query.md); pairs with [selectable schema](table_selectableschema.md) (row actions vs bulk actions on `$records`).
- Pairs with [accordable schema](table_accordableschema.md) (expand row detail) and [header schema](table_headerschema.md) (table-level actions over `$query`).
- Combine with [poll](table_polling.md) for live action lists.

See also: [Table](../table.md), [Components basics](../../basics.md), [query](table_query.md), [selectable schema](table_selectableschema.md).