Skip to content

Instantly share code, notes, and snippets.

@Sottti
Last active February 3, 2025 09:57
Show Gist options
  • Save Sottti/a9c71e091bd989f1eeb7b6e465e6128a to your computer and use it in GitHub Desktop.
Save Sottti/a9c71e091bd989f1eeb7b6e465e6128a to your computer and use it in GitHub Desktop.
One of the trickiest cases to write previews
@Composable
public fun ListItem(
modifier: Modifier = Modifier,
primaryText: String,
primaryTextStyle: ListItemPrimaryTextStyle = ListItemPrimaryTextStyle.Default,
primaryTextColor: ListItemPrimaryTextColor = ListItemPrimaryTextColor.OnSurfaceOrBackground,
primaryTextDecoration: TextDecoration? = null,
secondaryText: String? = null,
secondarySlot: @Composable (() -> Unit)? = null,
startIcon: ListItemStartIcon? = null,
@DrawableRes endIconResId: Int? = null,
endIconColor: ListItemIconColor = Primary,
onEndIconClick: OnClick? = null,
trailingText: String? = null,
trailingTextStyle: ListItemTrailingTextStyle = OnSurfaceOrBackgroundMuted,
trailingTextDecoration: TextDecoration? = null,
indicatorBadge: ListItemIndicatorBadge? = null,
trailingSlot: @Composable (() -> Unit)? = null,
surface: ListItemSurfaceShape = ListItemSurfaceShape.None,
surfaceColor: ListItemSurfaceColor = ListItemSurfaceColor.Surface,
heightStyle: ListItemHeightStyle = Wrapped,
onClick: OnClick? = null,
)
@Sottti
Copy link
Author

Sottti commented Feb 3, 2025

@Sottti
Copy link
Author

Sottti commented Feb 3, 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment