Changing the colors
In the configuration, you can easily change the colors that are used. Filament ships with 6 predefined colors that are used everywhere within the framework. They are customizable as follows:Filament\Support\Colors\Color class contains color options for all Tailwind CSS color palettes.
You can also pass in a function to register() which will only get called when the app is getting rendered. This is useful if you are calling register() from a service provider, and want to access objects like the currently authenticated user, which are initialized later in middleware.
Alternatively, you may pass your own palette in as an array of OKLCH colors:
Generating a color palette
If you want us to attempt to generate a palette for you based on a singular hex or RGB value, you can pass that in:Changing the font
By default, we use the Inter font. You can change this using thefont() method in the configuration file:
Changing the font provider
Bunny Fonts CDN is used to serve the fonts. It is GDPR-compliant. If you’d like to use Google Fonts CDN instead, you can do so using theprovider argument of the font() method:
LocalFontProvider:
Creating a custom theme
Filament allows you to change the CSS used to render the UI by compiling a custom stylesheet to replace the default one. This custom stylesheet is called a “theme”. Themes use Tailwind CSS. To create a custom theme for a panel, you can use thephp artisan make:filament-theme command:
--pm option:
- Install the required Tailwind CSS dependencies
- Generate a CSS file in
resources/css/filament/{panel}/theme.css - Attempt to automatically add the theme to your
vite.config.jsinput array - Attempt to automatically register
->viteTheme()in your panel provider - Offer to compile the theme with Vite
Manual configuration
Add the theme’s CSS file to the Laravel plugin’sinput array in vite.config.js:
Check the command output for the exact file path (e.g.,
admin/theme.css), as it may vary depending on your panel’s ID.resources/css/filament.
Using Tailwind CSS classes in your Blade views or PHP files
If you want to use Tailwind CSS utility classes (liketext-primary-600, bg-gray-100, p-4, etc.) in your own Blade views, Livewire components, or PHP files, you must create a custom theme first.
Without a custom theme, any Tailwind classes you add to your code will simply not work - the styles won’t be applied because they’re not included in the compiled CSS.
Setting up Tailwind CSS for your project
To use Tailwind CSS classes in your project, you need to set up a custom theme. Run the following command:theme.css file, you will find @source directives that tell Tailwind CSS where to scan for classes:
@source directive in the Tailwind CSS documentation.
Dark mode
By default, Filament allows users to switch between light and dark mode. The following sections cover how to customize this behavior.Disabling dark mode
To disable dark mode entirely, you can use the configuration file:Hiding the theme switcher
By default, users can switch between light and dark mode using the theme switcher in the user menu. If you want to keep dark mode enabled but prevent users from manually switching (so that Filament follows the default theme mode or the user’s system preference), you can hide the theme switcher using thethemeSwitcher(false) method:
This is different from
darkMode(false), which disables dark mode altogether. themeSwitcher(false) keeps dark mode active but hides the switcher.Forcing dark mode
If you want to force the panel to always use dark mode, regardless of the user’s preference, you can passisForced: true to the darkMode() method. This also hides the theme switcher:
Changing the default theme mode
By default, Filament uses the user’s system theme as the default mode. For example, if the user’s computer is in dark mode, Filament will use dark mode by default. The system mode in Filament is reactive if the user changes their computer’s mode. If you want to change the default mode to force light or dark mode, you can use thedefaultThemeMode() method, passing ThemeMode::Light or ThemeMode::Dark:
Adding a logo
By default, Filament uses your app’s name to render a simple text-based logo. However, you can easily customize this. If you want to simply change the text that is used in the logo, you can use thebrandName() method:
brandLogo() method:
brandLogo() method to render an inline SVG element for example:
darkModeBrandLogo() in the same way.
The logo height defaults to a sensible value, but it’s impossible to account for all possible aspect ratios. Therefore, you may customize the height of the rendered logo using the brandLogoHeight() method:
Adding a favicon
To add a favicon, you can use the configuration file, passing the public URL of the favicon:Making a panel more compact
Data-heavy panels can be easier to scan when tables and controls use less space. The Compact theme provides a ready-made option that reduces the spacing throughout a panel while preserving Filament’s default mobile spacing. It can also be combined with the Sharp, Soft, or Noir themes if you want to change the visual style as well as the density. If you only need to make a few elements more compact, you can add targeted rules to your custom theme instead. For example, these rules reduce the vertical padding of table text cells and the padding of default-sized buttons on larger screens:sm breakpoint keeps Filament’s default spacing on smaller screens, where table rows are often presented as stacked content. You can target other elements in the same way using CSS hook classes.