How do I add icon to label of a column?

I am trying to add a icon to the label of a column to signify it has a tooltop
10 Replies
Dennis Koch
Dennis Koch2y ago
I don't think we support this 🤔 You'll probably need a custom column.
RichtheKid
RichtheKidOP2y ago
Is it possible to pass custom html to the ->label() ?
Dennis Koch
Dennis Koch2y ago
label(new HtmlString('your html'))
RichtheKid
RichtheKidOP2y ago
Alright thanks
RichtheKid
RichtheKidOP2y ago
I was able to add the icon, how do it make it appear on 1 line. Any suggestions?
toeknee
toeknee2y ago
->inlineLabel()
Dennis Koch
Dennis Koch2y ago
Share your code 🤷🏼‍♂️
RichtheKid
RichtheKidOP2y ago
BadgeColumn::make('avg_performance')->label(fn () => new HtmlString(__('rental-schedules-resource.performance') . Blade::render('<x-heroicon-o-question-mark-circle class="w-3 h-3" x-tooltip.raw="Custom text" />')))->extraAttributes(['class' => 'flex items-center']),
toeknee
toeknee2y ago
please read the #❓┊help on asking for help.
BadgeColumn::make('avg_performance')->label(fn () => new HtmlString(__('rental-schedules-resource.performance') . Blade::render('<x-heroicon-o-question-mark-circle class="w-3 h-3" x-tooltip.raw="Custom text" />')))->extraAttributes(['class' => 'flex items-center']),
BadgeColumn::make('avg_performance')->label(fn () => new HtmlString(__('rental-schedules-resource.performance') . Blade::render('<x-heroicon-o-question-mark-circle class="w-3 h-3" x-tooltip.raw="Custom text" />')))->extraAttributes(['class' => 'flex items-center']),
Looking at that, you will want to make them span's to be inline. or use div's with inlines
LeandroFerreira
A view could be better I think..
BadgeColumn::make('avg_performance')->label(view('custom-column'))
BadgeColumn::make('avg_performance')->label(view('custom-column'))
<!-- resources/views/custom-column.blade.php -->
<div class="flex items-center">
<span>__('rental-schedules-resource.performance')</span>
<x-heroicon-o-question-mark-circle class="w-3 h-3" x-tooltip.raw="Custom text" />
</div>
<!-- resources/views/custom-column.blade.php -->
<div class="flex items-center">
<span>__('rental-schedules-resource.performance')</span>
<x-heroicon-o-question-mark-circle class="w-3 h-3" x-tooltip.raw="Custom text" />
</div>
Want results from more Discord servers?
Add your server