Article

fun Article(article: ArticleUiState, onArticleClick: () -> Unit, onFavoriteClick: () -> Unit, modifier: Modifier = Modifier, onAudioClick: () -> Unit = {}, onMoreClick: () -> Unit = {}, colors: ArticleColors = ArticleDefault.articleColors())

An article row: cover, category, headline, teaser, and the actions that go with them.

Stateless — it renders article and reports taps, holding nothing itself. Bookmarking in particular is yours to apply: onFavoriteClick fires, you update ArticleUiState.isBookmarked and recompose.

The audio and overflow controls appear only when you pass a handler for them.

Parameters

article

what to render.

onArticleClick

the row itself was tapped — open the article.

onFavoriteClick

the bookmark control was tapped.

modifier

the Modifier to apply to the row.

onAudioClick

the audio control was tapped. Leave it out to hide the control.

onMoreClick

the overflow control was tapped. Leave it out to hide the control.

colors

the colors to draw with. Defaults to the ambient CgsTheme.