JengaThumbnailStrip

fun JengaThumbnailStrip(count: Int, modifier: Modifier = Modifier, onAdd: () -> Unit? = null, addContentDescription: String? = null, addIcon: @Composable () -> Unit = { JengaIcon(JengaTheme.icons.add, contentDescription = null) }, thumbnailSize: Dp = JengaTheme.components.thumbnailStrip?.thumbnailSize ?: JengaThumbnailStripDefaults.ThumbnailSize, spacing: Dp = JengaThumbnailStripDefaults.spacing, contentPadding: PaddingValues = JengaThumbnailStripDefaults.contentPadding, shape: Shape = JengaThumbnailStripDefaults.shape, colors: JengaThumbnailStripColors = JengaThumbnailStripDefaults.colors(), layout: JengaThumbnailStripLayout = JengaThumbnailStripLayout.Row, thumbnail: @Composable (index: Int) -> Unit)(source)

Square thumbnails (e.g. photos attached to a record) with an optional dashed "add" tile at the end, in one scrolling row or wrapped over several lines (see layout). Each thumbnail slot is clipped to shape and sized to thumbnailSize; put an image and any tap handling there.

Parameters

count

the number of thumbnails.

modifier

the Modifier for the strip.

onAdd

called when the add tile is tapped; null hides the tile.

addContentDescription

accessibility label for the add tile.

addIcon

the icon inside the add tile; inherits the add color.

thumbnailSize

the edge length of each thumbnail and the add tile; defaults to the theme's value, else JengaThumbnailStripDefaults.ThumbnailSize.

spacing

the gap between tiles, across and between lines.

contentPadding

padding around the tiles.

shape

the tile shape.

colors

the color set; defaults to JengaThumbnailStripDefaults.colors.

layout

one scrolling row, or wrapped lines; see JengaThumbnailStripLayout.

thumbnail

the content of the thumbnail at an index.

Samples

val photos = listOf(
    "https://example.com/1.jpg",
    "https://example.com/2.jpg",
)
JengaThumbnailStrip(
    count = photos.size,
    onAdd = {},
    addContentDescription = "Add photo",
    thumbnail = { index ->
        JengaImage(
            url = photos[index],
            contentDescription = null,
        )
    },
)