Hero background

Filter Layouts

Instead of limiting your users to a single filtering approach, Filament provides five distinct layout strategies that transform how filters are presented and accessed. From space-efficient dropdowns to immersive modal experiences, these layout options let you create filtering interfaces that perfectly match your application's workflow and user needs. Whether you need quick access filters for dashboard tables or comprehensive filtering for complex data exploration tools, Filament's layout system adapts to any scenario.

# Slide-over layout for contextual filtering

Slide-over layout for contextual filtering

Create an elegant side-panel experience that slides in from the right, maintaining context with your main content while providing dedicated space for filtering. The slide-over approach feels less intrusive than modals while offering more room than dropdowns.

->filters([
    SelectFilter::make('type')
        ->options([
            'increase' => 'Increase',
            'decrease' => 'Decrease',
            'correction' => 'Correction',
        ])
        ->multiple(),
    SelectFilter::make('user')
        ->relationship('user', 'name')
        ->searchable()
        ->preload(),
    Filter::make('created_at')
        ->schema([
            DatePicker::make('from'),
            DatePicker::make('until'),
        ])
        ->query(function () {
            // ...
        }),
    Filter::make('quantity_filter')
        ->schema([
            TextInput::make('min_quantity')
                ->numeric()
                ->label('Minimum Quantity'),
            TextInput::make('max_quantity')
                ->numeric()
                ->label('Maximum Quantity'),
        ])
        ->query(function () {
            // ...
        }),
], layout: FiltersLayout::Modal)

# Above content layout for immediate visibility

Above content layout for immediate visibility

Place filters directly above your table content for instant accessibility without any clicking required. This approach works excellently for frequently-used filtering options and scenarios where filter visibility drives user workflow and decision-making.

->filters([
    SelectFilter::make('type')
        ->options([
            'increase' => 'Stock Increases',
            'decrease' => 'Stock Decreases',
            'correction' => 'Stock Corrections',
        ])
        ->default('increase'),
    SelectFilter::make('user')
        ->relationship('user', 'name')
        ->searchable()
        ->preload(),
    TernaryFilter::make('recent')
        ->label('Time Period')
        ->placeholder('All Time')
        ->trueLabel('Last 30 Days')
        ->falseLabel('Last 7 Days')
        ->queries(
            true: fn (Builder $query) => $query->where('created_at', '>=', now()->subDays(30)),
            false: fn (Builder $query) => $query->where('created_at', '>=', now()->subDays(7)),
            blank: fn (Builder $query) => $query,
        ),
], layout: FiltersLayout::AboveContent)
->filtersFormColumns(3)