SimpleGrid
The simple grid is a layout component to build responsive interfaces.
Import
Importimport { SimpleGrid } from '@backyard-ui/core';Usage
UsageGap
GapUse the gap prop to increase or decrease the gap between columns.
Auto-responsive grid
Auto-responsive gridTo make it auto-responsive pass the minChildWidth prop to specify the min-width a child should have before adjusting the layout.
This uses css grid auto-fit and minmax() internally.
Responsive columns
Responsive columnsYou can make it responsive by passing array or object values into the columns prop.
API Reference
API Reference- children requiredDescription The children elementsTypeReactNode
- rowDescription The CSS `grid-row` propertyTypeGridRow
- columnsDescription The number of columnsTypeResponsiveValue<number>Default12
- columnDescription The CSS `grid-column` propertyTypeGridColumn
- autoColumnsDescription The CSS `grid-auto-columns` propertyTypeGridAutoColumns<string | number>
- autoFlowDescription The CSS `grid-auto-flow` propertyTypeGridAutoFlow
- autoRowsDescription The CSS `grid-auto-rows` propertyTypeGridAutoRows<string | number>
- gapXDescription The column gap between the grid itemsType"0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "14" | "16" | "20" | "24" | "28" | "32" | "36" | "40" | "44" | "48" | "52" | "56" | "60" | "64" | "72" | "80" | ... 6 more ...Default4
- gapYDescription The row gap between the grid itemsType"0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | "10" | "11" | "12" | "14" | "16" | "20" | "24" | "28" | "32" | "36" | "40" | "44" | "48" | "52" | "56" | "60" | "64" | "72" | "80" | ... 6 more ...Default4
- templateColumnsDescription The CSS `grid-template-columns` propertyTypeGridTemplateColumns<string | number>
- templateRowsDescription The CSS `grid-template-rows` propertyTypeGridTemplateRows<string | number>
- minChildWidthDescription The width at which child elements will break into columns.Typestring