Skip to content

Plugin setup

A typical configuration:

use Coolsam\FilamentChrome\Enums\NavigationType;
use Coolsam\FilamentChrome\Enums\SideNavMode;
use Coolsam\FilamentChrome\FilamentChromePlugin;
use Coolsam\FilamentChrome\Themes\ShamarTheme;
use Filament\Panel;
public function panel(Panel $panel): Panel
{
return $panel
// ...
->plugin(
FilamentChromePlugin::make()
->navigationType(NavigationType::App)
->sideNavMode(SideNavMode::Accordion)
->theme(ShamarTheme::make())
->primary('#F1511B')
->darkPrimary('#C9A57B') // optional .dark override only
->accent('#286291')
->darkAccent('#8FCBD6') // optional; omit → Filament default dark logic
);
}
Method Purpose
make() Create the plugin (plugin id filament-chrome).
theme(ChromeTheme $theme) Set the panel theme. Default: DefaultTheme. See Themes.
navigationType(NavigationType|string $type) Layout: Side, Top, App, AppInverse. See Navigation.
navigationTypeSide() / navigationTypeTop() / navigationTypeApp() / navigationTypeAppInverse() Shorthands for navigationType().
sideNavMode(SideNavMode|string $mode) Accordion or Static desktop side nav.
sideNavModeAccordion() / sideNavModeStatic() Shorthands for sideNavMode().
navigationAccordion(bool $accordion = true) true → Accordion, false → Static.
treeline(bool $enabled = true) Force nested-nav connector lines on or off.
primary(?string $hex) / accent(?string $hex) Brand colors. See Branding colors.
darkPrimary(?string $hex) / darkAccent(?string $hex) / darkGray(?string $hex) Optional .dark-only overrides.
themeSwitcher(false|array $themes = ThemeSwitcher::BUNDLED_THEMES) Enable the user theme switcher. Off by default.
themeSwitcherRenderHook(string $hook) Move the theme switcher trigger button.

String arguments are normalized: navigationType('sidebar'), 'inverse', 'app_inverse' and 'appinverse' are accepted aliases; unknown values fall back to App. sideNavMode() accepts 'accordion' or 'static'.

Every layout setting is resolved in the same order:

  1. Theme switcher override — when the switcher is enabled and the user picked a value.
  2. Explicit plugin config — ->navigationType(), ->sideNavMode() / ->navigationAccordion(), ->treeline().
  3. Active theme default — defaultNavigationType(), defaultSideNavMode(), defaultTreeline() when non-null.
  4. Package default — NavigationType::App, SideNavMode::Accordion, and treeline on for Accordion / off for Static.
use Coolsam\FilamentChrome\Themes\SoftFloatingTheme;
// Uses Soft Floating's Side + Accordion without calling ->navigationType()
FilamentChromePlugin::make()->theme(SoftFloatingTheme::make());
// Explicit plugin config always wins over the theme
FilamentChromePlugin::make()
->theme(SoftFloatingTheme::make())
->navigationType(NavigationType::Top);

Useful when building your own views or hooks on top of the plugin:

Getter Returns
getTheme() Active theme (the user’s switcher choice when enabled).
getConfiguredTheme() Theme from ->theme(), ignoring the switcher.
getDefaultTheme() ->theme() when the switcher offers it, otherwise the switcher’s first theme.
getNavigationType() / getSideNavMode() / hasTreeline() Resolved layout values.
getResolvedPrimary() / getResolvedAccent() Effective light colors (user choice → plugin → theme token).
hasThemeSwitcher() / getThemeSwitcher() Switcher state.