tinusg/filament-hover-image-column
Filament table HoverImageColumn: a drop-in replacement for ImageColumn that shows a larger image preview card on hover. Supports custom preview size, custom high-res preview URL, computed state, and disabling previews. No config or extra assets.
composer require tinusg/filament-hover-image-column in your Laravel project.ImageColumn: Swap any existing ImageColumn in your Filament table with HoverImageColumn:
use TinusG\FilamentHoverImageColumn\HoverImageColumn;
HoverImageColumn::make('avatar')
->circular();
ImageColumn for profile avatars or product images to provide a richer hover preview without additional UI clutter.Basic Replacement:
HoverImageColumn::make('image')
->label('Product Image')
->width(50);
ImageColumn with hover functionality.Dynamic Previews:
HoverImageColumn::make('thumbnail')
->previewUrl(fn ($record) => $record->high_res_image_url)
->previewSize(600, 400);
Computed State:
HoverImageColumn::make('media.source_url')
->state(fn ($record) => $record->getPrimaryMediaUrl())
->circular();
Conditional Previews:
HoverImageColumn::make('cover_image')
->preview(fn ($record) => $record->has_high_res_image ? true : false)
->previewSize(800);
width, height, circular) to match your app’s design.preview(false) for non-critical images.previewSize as needed.state() returns null or an invalid URL, the column renders as a broken image. Always validate URLs:
->state(fn ($record) => $record->image_url ?? null)
previewSize or CSS.php artisan filament:cache-reset
->state(fn ($record) => {
\Log::debug('Image URL:', [$record->image_url]);
return $record->image_url;
})
Custom Preview Content: Override the default preview template by publishing and modifying the view:
php artisan vendor:publish --tag=filament-hover-image-column:views
Edit resources/views/vendor/filament-hover-image-column/preview.blade.php.
Animation: Add CSS transitions to the preview card for smoother hover effects:
.filament-hover-image-preview {
transition: all 0.3s ease;
}
Accessibility:
Ensure previews include aria-label or alt text for screen readers:
->previewAltText('Larger image preview')
How can I help you explore Laravel packages today?