Ankh
Ankh
FFilament
Created by Ankh on 4/23/2025 in #❓┊help
Sidebar custom width of split infolist
Hi everyone, I'm struggling with the layout of an infolist page. I'm using a split to get a sidebar effect but this sidebar doesn't take enough space and I would like to specify 25% width for it. Here is my code simplified :
return $infolist
->schema([
Split::make([
Grid::make()
->schema([
Section::make('Informations')
->columns(2)
->schema([...])
Section::make('Communication')
->columns(2)
->schema([...])
]),
Section::make([...])->grow(false)
])->columnSpan('full')
return $infolist
->schema([
Split::make([
Grid::make()
->schema([
Section::make('Informations')
->columns(2)
->schema([...])
Section::make('Communication')
->columns(2)
->schema([...])
]),
Section::make([...])->grow(false)
])->columnSpan('full')
The ->grow(false) property makes the sidebar too narrow, but it's too large if I put grow(true). Inspecting the html code on the dev tools I've noticed that the split creates two divs, the first one having the classes "w-full flex-1" If I put
flex: 0.25 1 0
flex: 0.25 1 0
on the second div (the sidebar) it takes the width I want but I can't find the place where to add that as if I use ->extraAttributes on the Section (second part of the split), it puts the css on the <section> which is the child of the div I'd like to target. Any ideas of a solution I might be missing ? I've had no luck on all the topics related to splits in here or github/stackoverflow, etc. Thank you very much !
4 replies