Skip to main content

Introduction

The Split component (also known as Flex) creates flexible layouts using flexbox:
use Filament\Schemas\Components\Flex;
use Filament\Schemas\Components\Section;
use Filament\Forms\Components\Textarea;
use Filament\Forms\Components\TextInput;
use Filament\Forms\Components\Toggle;

Flex::make([
    Section::make([
        TextInput::make('title'),
        Textarea::make('content'),
    ]),
    Section::make([
        Toggle::make('is_published'),
        Toggle::make('is_featured'),
    ])->grow(false),
])->from('md')
This creates a flexible sidebar layout where the first section grows to fill available space.

Breakpoint

Control when the horizontal layout starts:
Flex::make([
    // ...
])->from('lg')
breakpoint
string | Closure
default:"'md'"
The Tailwind breakpoint (sm, md, lg, xl, 2xl).
On smaller devices, components stack vertically.

Controlling growth

By default, all components in a Flex grow to fill space. Prevent growth:
Section::make([
    // ...
])->grow(false)
condition
bool | Closure
default:"true"
Whether the component should grow.
Create a common sidebar pattern:
Flex::make([
    // Main content area (grows)
    Section::make([
        TextInput::make('title'),
        Textarea::make('content'),
        RichEditor::make('body'),
    ]),
    
    // Fixed-width sidebar
    Section::make([
        Toggle::make('is_published'),
        Select::make('category_id'),
        FileUpload::make('featured_image'),
    ])->grow(false),
])->from('md')

Alignment

Control how components align:
Flex::make([
    // ...
])
    ->alignItems('start') // top
    ->justifyContent('between') // space between

Direction

Control flex direction:
Flex::make([
    // ...
])
    ->direction('column') // vertical on all sizes
Or use responsive direction:
Flex::make([
    // ...
])
    ->from('md') // horizontal from md up, vertical below

Gap

Control spacing between items:
Flex::make([
    // ...
])
    ->gap('xl') // larger gap

Use cases

Content with metadata sidebar

Flex::make([
    Section::make('Content')
        ->schema([
            TextInput::make('title'),
            RichEditor::make('body'),
        ]),
    Section::make('Metadata')
        ->schema([
            DateTimePicker::make('published_at'),
            Select::make('status'),
        ])
        ->grow(false),
])->from('lg')

Compact forms

Flex::make([
    TextInput::make('first_name'),
    TextInput::make('last_name'),
])->from('sm')

Dashboard cards

Flex::make([
    Card::make()->schema([/* stats */]),
    Card::make()->schema([/* chart */])->grow(false),
])

Build docs developers (and LLMs) love