StylishConnectedCardLazyGrid

fun StylishConnectedCardLazyGrid(items: List<StylishConnectedCardItem>, columns: Int, modifier: Modifier = Modifier, spacing: Dp = StylishTheme.dimensions.connectedSpacing, contentPadding: PaddingValues = PaddingValues(horizontal = DefaultStylishDimensions.controlPadding), listState: LazyGridState = rememberLazyGridState(), containerColor: Color? = null, contentColor: Color? = null, disabledContainerColor: Color = MaterialTheme.colorScheme.surfaceVariant, disabledContentColor: Color = MaterialTheme.colorScheme.onSurfaceVariant, titleStyle: TextStyle = MaterialTheme.typography.titleLarge, supportingTextStyle: TextStyle = MaterialTheme.typography.bodySmall, titleMaxLines: Int = 1, titleOverflow: TextOverflow = TextOverflow.Ellipsis, supportingTextMaxLines: Int = 1, supportingTextOverflow: TextOverflow = TextOverflow.Ellipsis, minHeight: Dp = DefaultStylishDimensions.cardMinHeight, horizontalPadding: Dp = DefaultStylishDimensions.controlPadding, verticalPadding: Dp = DefaultStylishDimensions.controlVerticalPadding, contentSpacing: Dp = StylishTheme.dimensions.itemSpacing, titleSpacing: Dp = StylishTheme.dimensions.inlineSpacing, card: StylishConnectedCardItemContent = { item, itemModifier, shape, edges, corners -> DefaultStylishConnectedCardItem( item, itemModifier, shape, edges, corners, containerColor = containerColor, contentColor = contentColor, disabledContainerColor = disabledContainerColor, disabledContentColor = disabledContentColor, titleStyle = titleStyle, supportingTextStyle = supportingTextStyle, titleMaxLines = titleMaxLines, titleOverflow = titleOverflow, supportingTextMaxLines = supportingTextMaxLines, supportingTextOverflow = supportingTextOverflow, minHeight = minHeight, horizontalPadding = horizontalPadding, verticalPadding = verticalPadding, contentSpacing = contentSpacing, titleSpacing = titleSpacing, ) })

A lazily-composed grid of connected cards laid out in equal-width cells across a fixed number of columns, with shared outlines and corner radii — suited for scrollable statistics dashboards or tile galleries.

This is the Finish-layer component: it supplies the Stylish card rendering (DefaultStylishConnectedCardItem) to the headless Structure layout ConnectedCardLazyGrid, which owns arrangement and connection geometry. Only the visible rows are composed, while the connection geometry is computed exactly as in the eager StylishConnectedCardGrid: items are chunked into rows of columns cards, within each row every card receives equal weight, corner radii are computed from each item's absolute index so that only the four outer corners of the entire grid are rounded, and a partially filled final row stretches to fill the full row width. Pass a custom card to override the Stylish rendering while keeping the connected geometry.

Parameters

items

The list of StylishConnectedCardItem data objects that describe each card's title, supporting text, click actions, and slot content.

columns

The number of equal-width columns in the grid. Must be greater than zero.

spacing

The gap between adjacent cards both horizontally and vertically. Defaults to StylishTheme.dimensions.connectedSpacing (3 dp).

contentPadding

PaddingValues applied around the entire lazy grid. Defaults to DefaultStylishDimensions.controlPadding horizontal padding.

listState

LazyGridState controlling scroll position. Defaults to rememberLazyGridState. Supply a hoisted state to observe scroll offset or programmatically scroll.

containerColor

Background color of each card. When null, defaults to MaterialTheme.stylishComponentColors.groupedContainer.

contentColor

Content color of each card. When null, defaults to an enabled/disabled-aware color.

disabledContainerColor

Background color of each card when its StylishConnectedCardItem.enabled is false.

disabledContentColor

Content color of each card when its StylishConnectedCardItem.enabled is false.

titleStyle

The TextStyle applied to each card's title.

supportingTextStyle

The TextStyle applied to each card's supporting text.

titleMaxLines

Maximum number of lines for each card's title. Defaults to 1.

titleOverflow

The TextOverflow strategy for each card's title. Defaults to TextOverflow.Ellipsis.

supportingTextMaxLines

Maximum number of lines for each card's supporting text. Defaults to 1.

supportingTextOverflow

The TextOverflow strategy for each card's supporting text. Defaults to TextOverflow.Ellipsis.

minHeight

Minimum height of each card body. Defaults to DefaultStylishDimensions.cardMinHeight (77 dp).

horizontalPadding

Horizontal padding inside each card. Defaults to DefaultStylishDimensions.controlPadding (16 dp).

verticalPadding

Vertical padding inside each card. Defaults to DefaultStylishDimensions.controlVerticalPadding (12 dp).

contentSpacing

Horizontal gap between slots inside each card. Defaults to StylishTheme.dimensions.itemSpacing (8 dp).

titleSpacing

Vertical gap between title and supporting text inside each card. Defaults to StylishTheme.dimensions.inlineSpacing (4 dp).

card

A composable lambda that renders a single card. Receives the item data, a modifier (fill-max-width within an equal-weight cell), the connected Shape, the outline ConnectedEdges, and the outline ConnectedCorners. Defaults to DefaultStylishConnectedCardItem, which delegates to the com.segnities007.stylishui.components.atoms.StylishConnectedCard atom with the styling parameters above.

See also