© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
3 replies
Conor Hambuch

Select field allowHtml does not render <img> tags.

I have a select field which i want to render images and descriptions, so I have to use custom html, but img tags are not rendered.
The field:

Forms\Components\Select::make('product')->options(array_map(function($product){
return $this->productToHtml($product);
}, $products))->allowHtml()

and the helper function:

public function productToHtml($product){
return '<img src="' . $product['imageUrls'][0] . '" alt="No image" ></img>' .
$product["name"] ;
}

(images are from external sources)

This code renders only the product names.

Edit: I checked it and all html classes are removed from the rendered code.
Solution
This only works if ->native(false) is set, but this is not documented.
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

Select value when using allowHtml
FilamentFFilament / ❓┊help
3y ago
Select field doesn't render
FilamentFFilament / ❓┊help
4mo ago
Error in documentation or code ( Select->allowHtml( ) )
FilamentFFilament / ❓┊help
2y ago
Select field not working
FilamentFFilament / ❓┊help
2y ago