-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15109 from ModestasV/panels-navigation-documentation
Panels navigation documentation
- Loading branch information
Showing
51 changed files
with
673 additions
and
39 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
docs-assets/app/app/Livewire/Panels/Navigation/ActiveIcon.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
namespace App\Livewire\Panels\Navigation; | ||
|
||
use Filament\Pages\Page; | ||
use Filament\Navigation\NavigationItem; | ||
|
||
class ActiveIcon extends Page | ||
{ | ||
protected static string $view = 'livewire.panels.navigation.empty'; | ||
|
||
public function mount() | ||
{ | ||
filament() | ||
->getCurrentPanel() | ||
->navigationItems([ | ||
NavigationItem::make() | ||
->label('Settings Inactive') | ||
->url(fn (): string => '#') | ||
->activeIcon('heroicon-o-document-text') | ||
->icon('heroicon-o-cog'), | ||
NavigationItem::make('') | ||
->label('Settings Active') | ||
->url(fn (): string => '#') | ||
->isActiveWhen(fn() => request()->path() === 'panels/navigation/active-icon') | ||
->activeIcon('heroicon-s-cog') | ||
->icon('heroicon-s-cog'), | ||
]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
namespace App\Livewire\Panels\Navigation; | ||
|
||
use Filament\Navigation\NavigationItem; | ||
use Filament\Pages\Page; | ||
|
||
class Badge extends Page | ||
{ | ||
protected static string $view = 'livewire.panels.navigation.empty'; | ||
|
||
public function mount() | ||
{ | ||
filament() | ||
->getCurrentPanel() | ||
->navigationItems([ | ||
NavigationItem::make() | ||
->label('Orders') | ||
->url(fn(): string => '#') | ||
->icon('heroicon-o-shopping-cart') | ||
->badge(24), | ||
]); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
docs-assets/app/app/Livewire/Panels/Navigation/BadgeColor.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
namespace App\Livewire\Panels\Navigation; | ||
|
||
use Filament\Navigation\NavigationItem; | ||
use Filament\Pages\Page; | ||
use Filament\Support\Colors\Color; | ||
|
||
class BadgeColor extends Page | ||
{ | ||
protected static string $view = 'livewire.panels.navigation.empty'; | ||
|
||
public function mount() | ||
{ | ||
filament() | ||
->getCurrentPanel() | ||
->navigationItems([ | ||
NavigationItem::make() | ||
->label('Orders') | ||
->url(fn(): string => '#') | ||
->icon('heroicon-o-shopping-cart') | ||
->badge(32, Color::Red), | ||
]); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
docs-assets/app/app/Livewire/Panels/Navigation/BadgeTooltip.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
namespace App\Livewire\Panels\Navigation; | ||
|
||
use Filament\Navigation\NavigationItem; | ||
use Filament\Pages\Page; | ||
|
||
class BadgeTooltip extends Page | ||
{ | ||
protected static string $view = 'livewire.panels.navigation.empty'; | ||
|
||
public function mount() | ||
{ | ||
filament() | ||
->getCurrentPanel() | ||
->navigationItems([ | ||
NavigationItem::make() | ||
->label('Users') | ||
->url(fn(): string => '#') | ||
->icon('heroicon-o-user-group') | ||
->badge(12) | ||
->badgeTooltip('The number of users'), | ||
]); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
docs-assets/app/app/Livewire/Panels/Navigation/ChangeIcon.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
namespace App\Livewire\Panels\Navigation; | ||
|
||
use Filament\Pages\Page; | ||
use Filament\Navigation\NavigationItem; | ||
|
||
class ChangeIcon extends Page | ||
{ | ||
protected static string $view = 'livewire.panels.navigation.empty'; | ||
|
||
public function mount() | ||
{ | ||
filament() | ||
->getCurrentPanel() | ||
->navigationItems([ | ||
NavigationItem::make() | ||
->label('Settings') | ||
->url(fn (): string => '#') | ||
->icon('heroicon-o-document-text'), | ||
]); | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
docs-assets/app/app/Livewire/Panels/Navigation/CustomItems.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace App\Livewire\Panels\Navigation; | ||
|
||
use Filament\Pages\Page; | ||
use Filament\Pages\Dashboard; | ||
use Filament\Navigation\NavigationItem; | ||
|
||
class CustomItems extends Page | ||
{ | ||
protected static string $view = 'livewire.panels.navigation.empty'; | ||
|
||
public function mount() | ||
{ | ||
filament() | ||
->getCurrentPanel() | ||
->navigationItems([ | ||
NavigationItem::make('Analytics') | ||
->url('https://filament.pirsch.io', shouldOpenInNewTab: true) | ||
->icon('heroicon-o-presentation-chart-line') | ||
->group('Reports') | ||
->sort(3), | ||
NavigationItem::make('dashboard') | ||
->label(fn (): string => __('filament-panels::pages/dashboard.title')) | ||
->url(fn (): string => Dashboard::getUrl()) | ||
->isActiveWhen(fn () => request()->routeIs('filament.admin.pages.dashboard')), | ||
]); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
docs-assets/app/app/Livewire/Panels/Navigation/DisabledNavigation.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
namespace App\Livewire\Panels\Navigation; | ||
|
||
use Filament\Pages\Page; | ||
|
||
class DisabledNavigation extends Page | ||
{ | ||
protected static string $view = 'livewire.panels.navigation.empty'; | ||
|
||
public function mount() | ||
{ | ||
filament() | ||
->getCurrentPanel() | ||
->navigation(false); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
namespace App\Livewire\Panels\Navigation; | ||
|
||
use Filament\Navigation\NavigationItem; | ||
use Filament\Pages\Page; | ||
|
||
class Group extends Page | ||
{ | ||
protected static string $view = 'livewire.panels.navigation.empty'; | ||
|
||
public function mount() | ||
{ | ||
filament() | ||
->getCurrentPanel() | ||
->navigationItems([ | ||
NavigationItem::make() | ||
->label('Bank Accounts') | ||
->url(fn(): string => '#') | ||
->group('Settings') | ||
->icon('heroicon-o-currency-dollar'), | ||
]); | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
docs-assets/app/app/Livewire/Panels/Navigation/GroupCollapsible.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
namespace App\Livewire\Panels\Navigation; | ||
|
||
use Filament\Navigation\NavigationGroup; | ||
use Filament\Navigation\NavigationItem; | ||
use Filament\Pages\Page; | ||
|
||
class GroupCollapsible extends Page | ||
{ | ||
protected static string $view = 'livewire.panels.navigation.empty'; | ||
|
||
public function mount() | ||
{ | ||
filament() | ||
->getCurrentPanel() | ||
->navigationGroups([ | ||
NavigationGroup::make('Settings')->collapsed() | ||
]) | ||
->navigationItems([ | ||
NavigationItem::make() | ||
->label('Bank Accounts') | ||
->url(fn(): string => '#') | ||
->group('Settings') | ||
->icon('heroicon-o-currency-dollar'), | ||
]); | ||
} | ||
} |
28 changes: 28 additions & 0 deletions
28
docs-assets/app/app/Livewire/Panels/Navigation/GroupNotCollapsible.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
namespace App\Livewire\Panels\Navigation; | ||
|
||
use Filament\Navigation\NavigationGroup; | ||
use Filament\Navigation\NavigationItem; | ||
use Filament\Pages\Page; | ||
|
||
class GroupNotCollapsible extends Page | ||
{ | ||
protected static string $view = 'livewire.panels.navigation.empty'; | ||
|
||
public function mount() | ||
{ | ||
filament() | ||
->getCurrentPanel() | ||
->navigationGroups([ | ||
NavigationGroup::make('Settings')->collapsible(false) | ||
]) | ||
->navigationItems([ | ||
NavigationItem::make() | ||
->label('Bank Accounts') | ||
->url(fn(): string => '#') | ||
->group('Settings') | ||
->icon('heroicon-o-currency-dollar'), | ||
]); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
docs-assets/app/app/Livewire/Panels/Navigation/SidebarCollapsibleOnDesktop.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
namespace App\Livewire\Panels\Navigation; | ||
|
||
use Filament\Pages\Page; | ||
use Filament\Navigation\NavigationItem; | ||
|
||
class SidebarCollapsibleOnDesktop extends Page | ||
{ | ||
protected static string $view = 'livewire.panels.navigation.empty'; | ||
|
||
public function mount() | ||
{ | ||
filament() | ||
->getCurrentPanel() | ||
->navigationItems([ | ||
NavigationItem::make() | ||
->label('Products') | ||
->sort(2) | ||
->icon('heroicon-o-document-text') | ||
->url(fn (): string => '#'), | ||
]) | ||
->sidebarCollapsibleOnDesktop(); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
docs-assets/app/app/Livewire/Panels/Navigation/SidebarFullyCollapsibleOnDesktop.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
namespace App\Livewire\Panels\Navigation; | ||
|
||
use Filament\Pages\Page; | ||
use Filament\Navigation\NavigationItem; | ||
|
||
class SidebarFullyCollapsibleOnDesktop extends Page | ||
{ | ||
protected static string $view = 'livewire.panels.navigation.empty'; | ||
|
||
public function mount() | ||
{ | ||
filament() | ||
->getCurrentPanel() | ||
->navigationItems([ | ||
NavigationItem::make() | ||
->label('Products') | ||
->sort(2) | ||
->icon('heroicon-o-document-text') | ||
->url(fn (): string => '#'), | ||
]) | ||
->sidebarFullyCollapsibleOnDesktop(); | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
docs-assets/app/app/Livewire/Panels/Navigation/SortItems.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
namespace App\Livewire\Panels\Navigation; | ||
|
||
use Filament\Pages\Page; | ||
use Filament\Navigation\NavigationItem; | ||
|
||
class SortItems extends Page | ||
{ | ||
protected static string $view = 'livewire.panels.navigation.empty'; | ||
|
||
public function mount() | ||
{ | ||
filament() | ||
->getCurrentPanel() | ||
->navigationItems([ | ||
NavigationItem::make() | ||
->label('Products') | ||
->badge("2") | ||
->sort(2) | ||
->icon('heroicon-o-document-text') | ||
->url(fn (): string => '#'), | ||
NavigationItem::make('') | ||
->label('Orders') | ||
->badge("1") | ||
->sort(1) | ||
->icon('heroicon-o-document-text') | ||
->url(fn (): string => '#'), | ||
]); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
docs-assets/app/app/Livewire/Panels/Navigation/TopNavigation.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
namespace App\Livewire\Panels\Navigation; | ||
|
||
use Filament\Pages\Page; | ||
use Filament\Pages\Dashboard; | ||
use Filament\Navigation\NavigationItem; | ||
|
||
class TopNavigation extends Page | ||
{ | ||
protected static string $view = 'livewire.panels.navigation.empty'; | ||
|
||
public function mount() | ||
{ | ||
filament() | ||
->getCurrentPanel() | ||
->navigationItems([ | ||
NavigationItem::make('Analytics') | ||
->url('https://filament.pirsch.io', shouldOpenInNewTab: true) | ||
->icon('heroicon-o-presentation-chart-line') | ||
->group('Reports') | ||
->sort(3), | ||
NavigationItem::make('dashboard') | ||
->label(fn (): string => __('filament-panels::pages/dashboard.title')) | ||
->url(fn (): string => Dashboard::getUrl()) | ||
->isActiveWhen(fn () => request()->routeIs('filament.admin.pages.dashboard')), | ||
]) | ||
->topNavigation(); | ||
} | ||
} |
6 changes: 3 additions & 3 deletions
6
docs-assets/app/app/Livewire/Topbar.php → ...nels/Navigation/UserMenuCustomization.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.