© 2026 Hedgehog Software, LLC

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

allowing html in option labels of `select` component

I used the exact code in Filament's documentation

use Filament\Forms\Components\Select;
 
Select::make('technology')
    ->options([
        'tailwind' => '<span class="text-blue-500">Tailwind</span>',
        'alpine' => '<span class="text-green-500">Alpine</span>',
        'laravel' => '<span class="text-red-500">Laravel</span>',
        'livewire' => '<span class="text-pink-500">Livewire</span>',
    ])
    ->searchable()
    ->allowHtml()
use Filament\Forms\Components\Select;
 
Select::make('technology')
    ->options([
        'tailwind' => '<span class="text-blue-500">Tailwind</span>',
        'alpine' => '<span class="text-green-500">Alpine</span>',
        'laravel' => '<span class="text-red-500">Laravel</span>',
        'livewire' => '<span class="text-pink-500">Livewire</span>',
    ])
    ->searchable()
    ->allowHtml()


not only in my own project, but also I've tried it in Filament's demo project,
but none of the color related classes such as
text-*
text-*
or
bg-*
bg-*
are working.

this issue is while classes like
italic
italic
,
font-bold
font-bold
,
line-through
line-through
are successfully applied.

use Filament\Forms\Components\Select;
 
Select::make('technology')
    ->options([
        'tailwind' => '<span class="italic">Tailwind</span>',
        'alpine' => '<span class="text-bold">Alpine</span>',
        'laravel' => '<span class="line-through">Laravel</span>',
        'livewire' => '<span class="underline">Livewire</span>',
    ])
    ->searchable()
    ->allowHtml()
use Filament\Forms\Components\Select;
 
Select::make('technology')
    ->options([
        'tailwind' => '<span class="italic">Tailwind</span>',
        'alpine' => '<span class="text-bold">Alpine</span>',
        'laravel' => '<span class="line-through">Laravel</span>',
        'livewire' => '<span class="underline">Livewire</span>',
    ])
    ->searchable()
    ->allowHtml()


Is it due to something I missed when configuring the project?
Select - Form Builder - Filament
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

AttachAction custom select option labels
FilamentFFilament / ❓┊help
3y ago
Multi-Select Losing State (with HTML option)
FilamentFFilament / ❓┊help
14mo ago
Pagination in select option
FilamentFFilament / ❓┊help
3y ago