F
Filament2y ago
Remi

Label on form field, custom view

Im trying to use my own view for the label of a select form field.
public function label(string | Htmlable | Closure | null $label): static
{
$this->label = $label;

return $this;
}
public function label(string | Htmlable | Closure | null $label): static
{
$this->label = $label;

return $this;
}
Label accepts Htmlable and Closure, so i'm thinking this should be possible. But when i use:
Select::make('type')
->label(fn() => view('forms.components.label-with-tooltip'))
Select::make('type')
->label(fn() => view('forms.components.label-with-tooltip'))
It just escapes the HTML and prints the output. Is this possible? and how?
2 Replies
Dan Harrin
Dan Harrin2y ago
label(new HtmlString('html'))
Remi
RemiOP2y ago
Dan, you're a legend
Want results from more Discord servers?
Add your server