How can I keep an icon in the column label instead of text in the table?

I'm trying to implement a table, and in one column, I want an icon instead of a text label. Can anyone help me with this? Thank you.
Solution
TextColumn::make('status')
  ->label(view('test-dummy'))

// test-dummy.blade.php
<x-filament::icon icon="heroicon-o-user" class="w-5 h-5"/>


Or as an alternative approach without a view

 TextColumn::make('status')
      ->label(function () {
          return new HtmlString(Blade::render('<x-filament::icon icon="heroicon-o-user" class="w-5 h-5" />'));
      })


Thats one way. But please have accessibility in mind 💪
Was this page helpful?