Skip to main content
You are currently viewing the documentation for Filament 4.x, which is a previous version of Filament.Looking for the current stable version? Visit the 5.x documentation.

Introduction

The color column allows you to show the color preview from a CSS color definition, typically entered using the color picker field, in one of the supported formats (HEX, HSL, RGB, RGBA).
use Filament\Tables\Columns\ColorColumn;

ColorColumn::make('color')

Allowing the color to be copied to the clipboard

You may make the color copyable, such that clicking on the preview copies the CSS value to the clipboard, and optionally specify a custom confirmation message and duration in milliseconds. This feature only works when SSL is enabled for the app.
use Filament\Tables\Columns\ColorColumn;

ColorColumn::make('color')
    ->copyable()
    ->copyMessage('Copied!')
    ->copyMessageDuration(1500)
Optionally, you may pass a boolean value to control if the text should be copyable or not:
use Filament\Tables\Columns\ColorColumn;

ColorColumn::make('color')
    ->copyable(FeatureFlag::active())

Wrapping multiple color blocks

Color blocks can be set to wrap if they can’t fit on one line, by setting wrap():
use Filament\Tables\Columns\ColorColumn;

ColorColumn::make('color')
    ->wrap()
The “width” for wrapping is affected by the column label, so you may need to use a shorter or hidden label to wrap more tightly.