Badge column
概述
徽章列(BadgeColumn)用于渲染彩色徽章:
use Filament\Tables\Columns\BadgeColumn;
BadgeColumn::make('status')
->enum([
'draft' => 'Draft',
'reviewing' => 'Reviewing',
'published' => 'Published',
])
自定义颜色
徽章可以有颜色。颜色值可以是 danger
、gray
、info
、primary
、success
或 warning
:
use Filament\Tables\Columns\BadgeColumn;
BadgeColumn::make('status')
->colors([
'primary',
'gray' => 'draft',
'warning' => 'reviewing',
'success' => 'published',
'danger' => 'rejected',
])