tourze/easy-admin-image-preview-field-bundle

EasyAdmin image preview field with modal support

Installs: 45

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

Type:symfony-bundle

pkg:composer/tourze/easy-admin-image-preview-field-bundle

This package is auto-updated.

Last update: 2025-10-31 19:57:06 UTC


README

English | 中文

EasyAdmin bundle providing image preview fields with modal support.

Usage

use Tourze\EasyAdminImagePreviewFieldBundle\Field\ImagePreviewField;

public function configureFields(string $pageName): iterable
{
    // Basic usage
    yield ImagePreviewField::new('url', 'Image');
    
    // Custom configuration
    yield ImagePreviewField::new('imageUrl', 'Preview')
        ->setWidthProperty('imageWidth')    // default: 'width'
        ->setHeightProperty('imageHeight')  // default: 'height'  
        ->setFilenameProperty('originalName') // default: 'fileName'
        ->setMaxSize(120, 80)              // list view size
        ->setDetailMaxSize(400, 300);      // detail view size
}

Features

  • List view: Small thumbnails with modal preview on click
  • Detail view: Larger preview images with "open in new window" link
  • Configurable: Customize property names and sizes
  • Responsive: Modal closes on click/ESC key