© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•2y ago•
23 replies
Wirkhof

How to customize the label for options in CheckboxList?

Right now I am getting the options for ChecboxList like:
CheckboxList::make('cars')
  ->options(
      Car::where('is_red', true)
          ->orderBy('year', 'desc')
          ->pluck('name', 'id')
    )
CheckboxList::make('cars')
  ->options(
      Car::where('is_red', true)
          ->orderBy('year', 'desc')
          ->pluck('name', 'id')
    )


and it works.

But I need to do custom made each option that can use HTML code, for example:

<span style="font-weight: bold;">name<span> - with ID: <span>id</span>
<span style="font-weight: bold;">name<span> - with ID: <span>id</span>


How to do that?
Solution
Use
new HtmlString()
new HtmlString()
. And probably also
->allowHtml()
->allowHtml()
on the select
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
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

How to customize Breadcrumb label
FilamentFFilament / ❓┊help
3y ago
CheckboxList group options
FilamentFFilament / ❓┊help
3y ago
How to customize label when selecting relationship???
FilamentFFilament / ❓┊help
2y ago
Checkboxlist selecting all options
FilamentFFilament / ❓┊help
2y ago