FilamentF
Filament2y ago
3 replies
manojhl 🇮🇳

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'),
Was this page helpful?