- Implementation
- Layout Props
- Layout.Item Props
Common Examples
Using layouts in pages
In general, theLayout component is intended to be used as the child of a Page.Content component. Using these components together creates the foundation of page layouts in Anvil2.Fixed and fluid layouts
By default, layouts are fixed, meaning that they have a maximum width of1280px and are centered on the page. On smaller screens, they become fluid and fill the width of the page.fluid prop on the Layout component to true.Responsive layouts
Layout items come with responsive styles baked-in. As the parent layout becomes more narrow, the layout items will adjust accordingly based on the number of columns available in that breakpoint.For example, aLayout.Item with span={4} will take up a third of the width on breakpoints lg, xl, and xxl, two-thirds on the md breakpoint, and full-width on sm breakpoint and below.Note – these breakpoints correspond to the size of the layout rather than the screen, using container queries. Sidebars and panels may also affect the number of columns displayed.The Layout.Item also features responsive props, which can be used to override the span value at specific breakpoints. See the Layout.Item Props for details.Layout density variants
Use thevariant prop of the Layout component to control the gap between the layout items. Note that the gap will also change based on the width of the layout.Narrow
Default
Wide
Best Practices
- Use the
Layoutcomponent as the first child of the Page.Content component. - Use layouts to appropriately divide a page into columns, then use the Grid and Flex components to create smaller UI layouts within the content of the page.



