This package is tailored for Filament Admin Panel v2.x.
Make sure you have installed the admin panel before you continue with the installation. You can check the documentation here
The package provides the HasOnlyIcon
trait for Filament Admin Panel v2.x. With this trait it is possible to display the table actions buttons only as icon or optionally only as icon including tooltip. The package currently provides the table action buttons (CreateAction
, DeleteAction
, EditAction
and ViewAction
) that already contain the trait. Own table action buttons can be extended with the HasOnlyIcon
trait, so that the methods are then available.
PHP: 8.1
Laravel: 9
You can install the package via composer:
composer require maggomann/filament-only-icon-display
Use the supplied classes in your filament project as usual
use Filament\Resources\RelationManagers\RelationManager;
use Maggomann\FilamentOnlyIconDisplay\Domain\Tables\Actions\CreateAction;
use Maggomann\FilamentOnlyIconDisplay\Domain\Tables\Actions\DeleteAction;
use Maggomann\FilamentOnlyIconDisplay\Domain\Tables\Actions\EditAction;
use Maggomann\FilamentOnlyIconDisplay\Domain\Tables\Actions\ViewAction;
class YourRelationManager extends RelationManager
{
public static function table(Table $table): Table
{
return $table
->actions([
CreateAction::make()->onlyIconAndTooltip(), // show icon and tooltip with the content of $this->name
EditAction::make()->onlyIconAndTooltip(), // show icon and tooltip with the content of $this->name
ViewAction::make()->onlyIconAndTooltip(), // show icon and tooltip with the content of $this->name
DeleteAction::make()->onlyIconAndTooltip(), // show icon and tooltip with the content of $this->name
])
//....
}
}
Or use your own table action class
use Filament\Tables\Actions\Action;
use Maggomann\FilamentOnlyIconDisplay\Domain\Tables\Traits\HasOnlyIcon;
class YourOwnAction extends Action
{
use HasOnlyIcon;
}
// ...
// ...
// ...
use Filament\Resources\RelationManagers\RelationManager;
use YourOwnAction;
class YourRelationManager extends RelationManager
{
public static function table(Table $table): Table
{
return $table
->actions([
YourOwnAction::make('you need a name')->onlyIconAndTooltip(),
])
//....
}
}
Displays only the icon including the tooltip.
use Filament\Tables\Actions\Action;
use Maggomann\FilamentOnlyIconDisplay\Domain\Tables\Traits\HasOnlyIcon;
class YourOwnAction extends Action
{
use HasOnlyIcon;
}
YourOwnAction::make('my name')->onlyIconAndTooltip(), // tooltip content: my name
YourOwnAction::make('my name')
->label('my label')
->onlyIconAndTooltip(), // tooltip content: my label
YourOwnAction::make('my name')
->label('my label')
->tooltip('my tooltip')
->onlyIconAndTooltip(), // tooltip content: my tooltip
Displays only the icon without the tooltip, no matter what label, name or tooltip they provide with the classic method names.
use Filament\Tables\Actions\Action;
use Maggomann\FilamentOnlyIconDisplay\Domain\Tables\Traits\HasOnlyIcon;
class YourOwnAction extends Action
{
use HasOnlyIcon;
}
YourOwnAction::make('my name')->onlyIcon(), // tooltip content: no content
YourOwnAction::make('my name')
->label('my label')
->onlyIcon(), // tooltip content: no content
YourOwnAction::make('my name')
->label('my label')
->tooltip('my tooltip')
->onlyIcon(), // tooltip content: no content
composer test
composer test:pest-coverage
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.
Please note that these packages for Filament are not officially operated by Filament and do not provide any support or warranty from the Filament team. The use of these packages is at your own risk.
This project represents unofficial extensions for Filament and is maintained by an independent community of developers. We strive to maintain compatibility with the current versions of Filament, but we cannot guarantee that the packages will function flawlessly or be compatible with future versions of Filament.
We recommend users to create backups of their projects and thoroughly test them before using these packages. If you have any questions, issues, or suggestions, we are available to assist you. However, please note that we cannot provide official support for these packages.
We would like to emphasize that Filament is a separate developer community independent of this project. For more information about Filament, please refer to the official Filament website.
Please read the license terms to learn more about the conditions for using these packages.