> Source: https://laravilt.com/docs/tables/actions/header-actions

# Header Actions

Actions in the table header.

## Create Action

```php
<?php

use Laravilt\Actions\CreateAction;

->headerActions([
    CreateAction::make()
        ->url(route('products.create')),
])
```

## Export Action

```php
<?php

use Laravilt\Actions\Action;

->headerActions([
    Action::make('export')
        ->label('Export All')
        ->icon('Download')
        ->action(function () {
            return response()->download(
                $this->exportTable(),
                'products.csv'
            );
        }),
])
```

## Import Action

```php
<?php

use Laravilt\Actions\Action;
use Laravilt\Forms\Components\FileUpload;

->headerActions([
    Action::make('import')
        ->label('Import')
        ->icon('Upload')
        ->form([
            FileUpload::make('file')
                ->acceptedFileTypes(['.csv', '.xlsx'])
                ->required(),
        ])
        ->action(function (array $data) {
            $this->importFile($data['file']);
        }),
])
```

## API Reference

| Method | Description |
|--------|-------------|
| `url()` | Redirect URL |
| `action()` | Action callback |
| `form()` | Action form |
| `icon()` | Button icon |
