Introduction
Filament uses CSS âhookâ classes to allow various HTML elements to be customized using CSS.Discovering hook classes
We could document all the hook classes across the entire Filament UI, but that would be a lot of work, and probably not very useful to you. Instead, we recommend using your browserâs developer tools to inspect the elements you want to customize, and then use the hook classes to target those elements. All hook classes are prefixed withfi-, which is a great way to identify them. They are usually right at the start of the class list, so they are easy to find, but sometimes they may fall further down the list if we have to apply them conditionally with JavaScript or Blade.
If you donât find a hook class youâre looking for, try not to hack around it, as it might expose your styling customizations to breaking changes in future releases. Instead, please open a pull request to add the hook class you need. We can help you maintain naming consistency. You probably donât even need to pull down the Filament repository locally for these pull requests, as you can just edit the Blade files directly on GitHub.
Applying styles to hook classes
For example, if you want to customize the color of the sidebar, you can inspect the sidebar element in your browserâs developer tools, see that it uses thefi-sidebar, and then add CSS to your app like this:
@apply directive to apply Tailwind classes to Filament elements:
!important modifier to override existing styles, but please use this sparingly, as it can make your styles difficult to maintain:
!important to only specific Tailwind classes, which is a little less intrusive, by prefixing the class name with !:
Common hook class abbreviations
We use a few common abbreviations in our hook classes to keep them short and readable:fiis short for âFilamentâfi-acis used to represent classes used in the Actions packagefi-fois used to represent classes used in the Forms packagefi-inis used to represent classes used in the Infolists packagefi-nois used to represent classes used in the Notifications packagefi-scis used to represent classes used in the Schema packagefi-tais used to represent classes used in the Tables packagefi-wiis used to represent classes used in the Widgets packagebtnis short for âbuttonâcolis short for âcolumnâctnis short for âcontainerâwrpis short for âwrapperâ
Publishing Blade views
You may be tempted to publish the internal Blade views to your application so that you can customize them. We donât recommend this, as it will introduce breaking changes into your application in future updates. Please use the CSS hook classes wherever possible. If you do decide to publish the Blade views, please lock all Filament packages to a specific version in yourcomposer.json file, and then update Filament manually by bumping this number, testing your entire application after each update. This will help you identify breaking changes safely.