Infolist Builder - Entries
Repeatable entry
Overview
The repeatable entry allows you to repeat a set of entries and layout components for items in an array or relationship.
use Filament\Infolists\Components\RepeatableEntry;use Filament\Infolists\Components\TextEntry; RepeatableEntry::make('comments') ->schema([ TextEntry::make('author.name'), TextEntry::make('title'), TextEntry::make('content') ->columnSpan(2), ]) ->columns(2)
As you can see, the repeatable entry has an embedded schema()
which gets repeated for each item.
![Repeatable entry](https://github.com/filamentphp/filament/blob/3.x/docs-assets/screenshots/images/light/infolists/entries/repeatable/simple.jpg?raw=true)
Grid layout
You may organize repeatable items into columns by using the grid()
method:
use Filament\Infolists\Components\RepeatableEntry; RepeatableEntry::make('comments') ->schema([ // ... ]) ->grid(2)
This method accepts the same options as the columns()
method of the grid. This allows you to responsively customize the number of grid columns at various breakpoints.
![Repeatable entry in grid layout](https://github.com/filamentphp/filament/blob/3.x/docs-assets/screenshots/images/light/infolists/entries/repeatable/grid.jpg?raw=true)
Removing the styled container
By default, each item in a repeatable entry is wrapped in a container styled as a card. You may remove the styled container using contained()
:
use Filament\Infolists\Components\RepeatableEntry; RepeatableEntry::make('comments') ->schema([ // ... ]) ->contained(false)
Edit on GitHubStill need help? Join our Discord community or open a GitHub discussion