Tabs

# Make

The Tabs component allows you to create tabs.

use MoonShine\Decorations\Tabs;
use MoonShine\Decorations\Tab;
use MoonShine\Fields\Text;
 
//...
 
public function components(): array
{
return [
Tabs::make([
Tab::make('Seo', [
Text::make('Seo title')
 
//...
]),
Tab::make('Categories', [
//...
])
])
];
}
 
//...

# Active tab

The method active() allows you to specify which tab should be active by default.

use MoonShine\Decorations\Tabs;
use MoonShine\Decorations\Tab;
 
//...
 
public function components(): array
{
return [
Tabs::make([
Tab::make('Seo', [
//...
]),
Tab::make('Categories', [
//...
])
->active()
])
];
}
 
//...

# Icon

use MoonShine\Decorations\Tabs;
use MoonShine\Decorations\Tab;
 
//...
 
public function components(): array
{
return [
Tabs::make([
Tab::make('Seo', [
//...
]),
Tab::make('Categories', [
//...
])
->icon('heroicons.outline.pencil')
])
];
}
 
//...