How to have HTML content inside tooltip

I have requirement to have a html table with a tooltip when you hover over a table column cell, i have tried everything possible to make it work. need some advice on this
Tables\Columns\TextColumn::make('avg_usd')
->label('Avg Salary')
->tooltip(function (Model $record) {
$html = "<strong>Custom Tooltip</strong><br>";
$html .= "This is a custom tooltip for the average salary.";
return new HtmlString($html);
})
// ->tooltip(fn (Model $salary) => '<pre>' . print_r($salary->kuubiik_calc, true) . '</pre>')
->description(fn (Model $salary) => "KC: $" . (is_array($salary->kuubiik_calc) ? $salary->kuubiik_calc['total'] : ''))
->money('USD'),
Tables\Columns\TextColumn::make('avg_usd')
->label('Avg Salary')
->tooltip(function (Model $record) {
$html = "<strong>Custom Tooltip</strong><br>";
$html .= "This is a custom tooltip for the average salary.";
return new HtmlString($html);
})
// ->tooltip(fn (Model $salary) => '<pre>' . print_r($salary->kuubiik_calc, true) . '</pre>')
->description(fn (Model $salary) => "KC: $" . (is_array($salary->kuubiik_calc) ? $salary->kuubiik_calc['total'] : ''))
->money('USD'),
3 Replies
LeandroFerreira
LeandroFerreira8mo ago
You can't, I think
manojhl
manojhlOP8mo ago
i tried to write a custom viewColumn didn't workout as expected \Filament\Tables\Columns\ViewColumn::make('avg_usd')->view('filament.tables.columns.tooltip-with-html') anyways @Leandro Ferreira thanks for reply, i'll think of making a issue/pr for this later week if i get time
awcodes
awcodes8mo ago
Check #lara-zeus-popover
Want results from more Discord servers?
Add your server