Image column

Columns

Images can be easily displayed within your table:

use Filament\Tables\Columns\ImageColumn;
 
ImageColumn::make('header_image')

The column in the database must contain the path to the image, relative to the root directory of its storage disk.

Managing the image disk

By default, the public disk will be used to retrieve images. You may pass a custom disk name to the disk() method:

use Filament\Tables\Columns\ImageColumn;
 
ImageColumn::make('header_image')->disk('s3')

Private images

Filament can generate temporary URLs to render private images, you may set the visibility() to private:

use Filament\Tables\Columns\ImageColumn;
 
ImageColumn::make('header_image')->visibility('private')

Rounding the image

You may make the image fully rounded(), which is useful for rendering avatars:

use Filament\Tables\Columns\ImageColumn;
 
ImageColumn::make('author.avatar')->rounded()

Customizing the size

You may customize the image size by passing a width() and height(), or both with size():

use Filament\Tables\Columns\ImageColumn;
 
ImageColumn::make('header_image')->width(200)
 
ImageColumn::make('header_image')->height(50)
 
ImageColumn::make('author.avatar')->size(40)

Custom attributes

You may customize the extra HTML attributes of the image using extraImgAttributes():

use Filament\Tables\Columns\ImageColumn;
 
ImageColumn::make('logo')
->extraImgAttributes(['title' => 'Company logo']),
Edit on GitHub

Still need help? Join our Discord community or open a GitHub discussion

Enjoying Filament?

We are open source at heart. To allow us to build new features, fix bugs, and run the community, we require your financial support.

Sponsor Filament on GitHub