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

### `selectableSchema` | `->setSelectableSchema([])`
The selectable schema is a set of buttons that can do actions on selected records, this will spawn checkboxes on the left side of the each table row. Can be used only in dynamic tables.

Every element of the schema will receive `$records` as parameter.

```php
Button::make('Delete records')
    ->setConfirmationMessage('Are you sure you want delete these records?')
    ->setPreIcon('delete')
    ->setType('danger')
    ->setAction(function ($records) {
    
        foreach($records as $r) {
            // delete records
        }
    
        return response()->json(['success' => 'Deleted with success.']);
    })
```

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

What it does: adds checkboxes to every row plus a bulk-action bar. Dynamic tables only (`setQuery()` required). Each schema element is a button whose `setAction()` closure receives the selected `$records` collection, so one click can delete, export or transition many rows. Static (`values`) tables have no record keys and cannot use it.

Minimal working example — Blade:
```php
{!!
    \KFramework\Components\Visual\Table::make()
        ->setSchema([
            \KFramework\Components\Visual\TableColumn::make('name')->setLabel('Name'),
        ])
        ->setQuery($usersQuery)
        ->setSelectableSchema([
            \KFramework\Components\Visual\Button::make('Delete records')
                ->setConfirmationMessage('Delete selected?')
                ->setType('danger')
                ->setAction(function ($records) {
                    foreach ($records as $r) { /* delete */ }
                    return response()->json(['success' => 'Deleted.']);
                }),
        ])
!!}
```
Controller: same shape with `Table::`, `TableColumn::`, `Button::` facades (see the full delete example above, kept unchanged).

What the user sees: a checkbox column on the left; ticking rows enables the bulk buttons (e.g. "Delete records" with confirmation). When the query returns no records, the table shows the empty message without selectable checkboxes and the bulk bar stays hidden.

Interaction:
- Requires [query](table_query.md); pairs with [buttons](table_buttons.md) (bulk vs per-row actions) and [header schema](table_headerschema.md) (bulk bar can live next to table-level buttons).
- Pairs with [accordable schema](table_accordableschema.md): rows can be both selectable and expandable.
- Respects [custom filters](table_customfilters.md): selection applies to the filtered set.

See also: [Table](../table.md), [Components basics](../../basics.md), [buttons](table_buttons.md), [header schema](table_headerschema.md).