Collapse

You're browsing the documentation for an old version of MoonShine. Consider upgrading your project to MoonShine 2.x.

The Collapse decorator allows you to minimize fields and blocks while keeping their state

use MoonShine\Decorations\Collapse;
use MoonShine\Decorations\Block;
 
//...
public function fields(): array
{
return [
Block::make([
Collapse::make('Title/Slug', [
Text::make('Title')
->fieldContainer(false),
 
Text::make('Slug')
->fieldContainer(false),
])
->show() // Display expanded (optional)
]);
];
}
//...