© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
10 replies
harps

Resource view heading html

Is there any way to add html into the heading of resource view.

II want to get something like

<h1>Batch <span class="text-primary">AUDITS_05_10_23</span></h1>
<h1>Batch <span class="text-primary">AUDITS_05_10_23</span></h1>


But returning html in the
getHeading()
getHeading()
function just prints the span mark up.

    public function getHeading(): string
    {
        // Use the field batch_name from the resource as the page heading.
        $heading = 'Batch <span class="text-primary">' . $this->record->batch_name . '</span>';
        return new HtmlString($heading);
    }
    public function getHeading(): string
    {
        // Use the field batch_name from the resource as the page heading.
        $heading = 'Batch <span class="text-primary">' . $this->record->batch_name . '</span>';
        return new HtmlString($heading);
    }


Cheers Dan
Solution
Return a
new HtmlString('')
new HtmlString('')
Jump to solution
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

Resource Manager rogue HTML
FilamentFFilament / ❓┊help
3y ago
RelationManager on View Resource
FilamentFFilament / ❓┊help
2y ago
Resource record title with Html
FilamentFFilament / ❓┊help
3y ago
Slow loading of resource view
FilamentFFilament / ❓┊help
3y ago