© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
2 replies
Lucky0

Adding tooltip for each badge in a table column

I couldn't figure out to make this function work. is it possible to do this?

what i have so far:
Tables\Columns\TextColumn::make('carFeatures.name')
                    ->badge()
                    ->tooltip(function (Tables\Columns\TextColumn $column, $record): string {
                        $states = $column->getState();

                        // dd($record->carFeatures->map(fn($query) => $query->description));
            
                        $tooltipContent = [];
                        if ($states !== null) {
                            foreach ($states as $state) {
                                $tooltipContent[] = $state;
                            }
                        } else {
                            $tooltipContent[] = null;
                        }
                        return implode(', ', $tooltipContent);
                    })
                    ->listWithLineBreaks()
                    ->limitList(2)
                    ->expandableLimitedList()
                    ->sortable(),
Tables\Columns\TextColumn::make('carFeatures.name')
                    ->badge()
                    ->tooltip(function (Tables\Columns\TextColumn $column, $record): string {
                        $states = $column->getState();

                        // dd($record->carFeatures->map(fn($query) => $query->description));
            
                        $tooltipContent = [];
                        if ($states !== null) {
                            foreach ($states as $state) {
                                $tooltipContent[] = $state;
                            }
                        } else {
                            $tooltipContent[] = null;
                        }
                        return implode(', ', $tooltipContent);
                    })
                    ->listWithLineBreaks()
                    ->limitList(2)
                    ->expandableLimitedList()
                    ->sortable(),

currently it will display all the features name when i hover into the feature column. but what i wanted is to display the feature's description for each of the badge if i hover onto them. please guide me.. thank you
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Table column badge
FilamentFFilament / ❓┊help
2y ago
HTML in tooltip for table columns
FilamentFFilament / ❓┊help
3y ago
Showing icons in Table Column Badge
FilamentFFilament / ❓┊help
2y ago
Tooltip on table column header
FilamentFFilament / ❓┊help
2y ago