F
Filament12mo ago
Dkil

How can I customize the sidebar to have this design?

5 Replies
jaocero
jaocero12mo ago
->navigation(function (NavigationBuilder $builder): NavigationBuilder {
return $builder->groups([
NavigationGroup::make('')
->items([
NavigationItem::make('Dashboard')
->icon('heroicon-o-home')
->isActiveWhen(fn (): bool => request()->routeIs('filament.admin.pages.dashboard'))
->url(fn (): string => Dashboard::getUrl()),
]),
NavigationGroup::make('Accounts')
->items([
...AdminUserResource::getNavigationItems(),
...OrganizationUserResource::getNavigationItems(),
...SecurityResearcherResource::getNavigationItems(),
])
->icon('heroicon-o-users'),
NavigationGroup::make('')
->items([
...OrganizationResource::getNavigationItems(),
]),
]);
})
->navigation(function (NavigationBuilder $builder): NavigationBuilder {
return $builder->groups([
NavigationGroup::make('')
->items([
NavigationItem::make('Dashboard')
->icon('heroicon-o-home')
->isActiveWhen(fn (): bool => request()->routeIs('filament.admin.pages.dashboard'))
->url(fn (): string => Dashboard::getUrl()),
]),
NavigationGroup::make('Accounts')
->items([
...AdminUserResource::getNavigationItems(),
...OrganizationUserResource::getNavigationItems(),
...SecurityResearcherResource::getNavigationItems(),
])
->icon('heroicon-o-users'),
NavigationGroup::make('')
->items([
...OrganizationResource::getNavigationItems(),
]),
]);
})
In you panel provider put this, then in your resources just remove all protected static ?string $navigationIcon
Solution
jaocero
jaocero12mo ago
No description
ConnorHowell
ConnorHowell12mo ago
Main theory is to manually setup your groups as per: https://filamentphp.com/docs/3.x/panels/navigation#customizing-navigation-groups Then for every resource/page in that group you remove the icon and it'll do that
ZedoX
ZedoX12mo ago
Add icon to your nav groups & remove them from your Resources
Dkil
DkilOP12mo ago
Thank you guys ❤️
Want results from more Discord servers?
Add your server