Skip to main content
Version: 1.0.5

IGridProps

@spartanfx/react v1.0.5


@spartanfx/react / IGridProps

Interface: IGridProps

Props for the Grid layout component. Fully responsive by default using container-based sizing (ResizeObserver).

Properties

PropertyTypeDescription
alignItems?AlignItemsAlignment of items along the column axis (vertical). Default 'stretch'
as?keyof IntrinsicElementsHTML element to render as the grid container. Default 'div'
breakThreshold?numberMinimum pixels required per "1fr unit". Used to determine when columns can fit in the container. Default 150
children?ReactNodeChild elements to render inside the grid.
className?stringOptional CSS class name for the grid container.
cols?string | numberColumn configuration: - "auto" (default): Uses CSS auto-fit with breakThreshold - number (e.g., 3): Fixed column count that collapses when space is insufficient - string with fr units (e.g., "1fr 2fr 1fr"): Template that collapses proportionally Default "auto"
columnGap?string | numberGap between columns. Overrides gap for column spacing.
dense?booleanWhen true, uses grid-auto-flow: dense for tighter packing. Note: This may visually reorder items (not DOM order). Default false
gap?string | numberGap between all grid items (both column and row). Accepts a number (pixels) or CSS string. Default 12
justifyItems?JustifyItemsAlignment of items along the row axis (horizontal). Default 'stretch'
maxCols?numberMaximum number of columns (only applies when cols="auto").
minCols?numberMinimum number of columns. Grid never collapses below this. Default 1
rowGap?string | numberGap between rows. Overrides gap for row spacing.
style?CSSPropertiesAdditional inline styles for the grid container.