TIL: Lorem ipsum text for Compose Previews

When working with Compose, I miss the tools:sample data that’s available in android View XML for rendering some sample data in view previews.

TIL: There’s nothing as extensive, but compose does provide a Lorem Ipsum preview parameter for previewing sample text.

private fun TextPreview(@PreviewParameter(LoremIpsum::class) text: String) {
        modifier = Modifier
    ) {
        Text(text = text, overflow = TextOverflow.Ellipsis)
Screenshot of the output showing a block of text consisting of random lorem ipsum
The output