How to render HTML in a Table's empty state description, e.g. emptyStateDescription()

Here are variations of what I have tried. None render the HTML and instead output the escaped HTML.
public static function table(Table $table): Table
{
return $table->emptyStateDescription('<div>Sample</div>')
}
public static function table(Table $table): Table
{
return $table->emptyStateDescription('<div>Sample</div>')
}
public static function table(Table $table): Table
{
return $table->emptyStateHeading(view('empty-state-heading'))
}
public static function table(Table $table): Table
{
return $table->emptyStateHeading(view('empty-state-heading'))
}
public static function table(Table $table): Table
{
return $table->emptyStateHeading(Markdown::inline(view('empty-state-heading')))
}
public static function table(Table $table): Table
{
return $table->emptyStateHeading(Markdown::inline(view('empty-state-heading')))
}
Here's what I am seeing:
No description
Solution:
That’s the intended way
Jump to solution
2 Replies
BuddhaNature
BuddhaNature9mo ago
I found a solution, but I'd still like to hear other opinions on this.
public static function table(Table $table): Table
{
return $table->emptyStateDescription(fn() => new HtmlString(view('empty-state-description')))
}
public static function table(Table $table): Table
{
return $table->emptyStateDescription(fn() => new HtmlString(view('empty-state-description')))
}
Solution
Dennis Koch
Dennis Koch9mo ago
That’s the intended way