FilamentF
Filament3y 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;
    }

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'))

It just escapes the HTML and prints the output.

Is this possible? and how?
Was this page helpful?