Skip to content

Commit

Permalink
feat: add docs for navigation groups url feature
Browse files Browse the repository at this point in the history
  • Loading branch information
saade committed Oct 31, 2023
1 parent 35b303e commit 1c2d6ca
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion packages/panels/docs/06-navigation.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ public function panel(Panel $panel): Panel
->icon('heroicon-o-shopping-cart'),
NavigationGroup::make()
->label('Blog')
->icon('heroicon-o-pencil'),
->icon('heroicon-o-pencil')
->url('/blogs'),
NavigationGroup::make()
->label(fn (): string => __('navigation.settings'))
->icon('heroicon-o-cog-6-tooth')
Expand Down Expand Up @@ -147,6 +148,19 @@ public function panel(Panel $panel): Panel
}
```

### Making navigation groups redirect to a URL

By default, navigation groups only serve as a label for the items within them. You may make a navigation group redirect to a URL by calling `url()` on the `NavigationGroup` object:

```php
use Filament\Navigation\NavigationGroup;

NavigationGroup::make()
->label('Blogs')
->icon('heroicon-o-pencil')
->url('/blogs');
```

## Collapsible sidebar on desktop

To make the sidebar collapsible on desktop as well as mobile, you can use the [configuration](configuration):
Expand Down

0 comments on commit 1c2d6ca

Please sign in to comment.