Package-level declarations

Types

Link copied to clipboard
data class CollectedPreview(val id: String, val displayName: String = id, val filePath: String? = null, val startLineNumber: Int? = null, val endLineNumber: Int? = null, val code: String? = null, val kdoc: String? = null, val content: @Composable () -> Unit) : PreviewLabPreview
Link copied to clipboard
@Preview(widthDp = 800, heightDp = -1)
annotation class LabPreview
Link copied to clipboard

Property delegate (ReadOnlyProperty<Any?, Sequence<CollectedPreview>>) used as the backing field type for properties declared with val x by collectModulePreviews() / collectAllModulePreviews(). Reading the property yields the underlying Sequence<CollectedPreview> directly, so consumers iterate the sequence with the standard kotlin.sequences operators (firstOrNull { ... }, take(N).toList(), toList(), …) without going through any wrapper accessor.

Link copied to clipboard
data class PreviewLabEvent(val title: String, val description: String? = null, val createAt: Instant = Clock.System.now())

Represents an event that occurred during preview interaction

Link copied to clipboard

Have me.tbsten.compose.preview.lab.gallery.previewlist.PreviewTreeNode.Preview information collected by gradle plugin. It can be used to display the Preview catalog by passing it to PreviewLabGallery.

Properties

Link copied to clipboard

CompositionLocal that indicates whether the current composition is inside a PreviewLabGallery card body. When true, PreviewLab will skip rendering its full UI and only render the preview content directly. This is used to show scaled-down preview thumbnails in the gallery view.

Link copied to clipboard

CompositionLocal that provides the current PreviewLabPreview being displayed. This is set by PreviewLabGallery when a preview is selected.

Functions

Link copied to clipboard

Provides a delegate that collects @Preview functions from this module and every dependency module that has the Compose Preview Lab Gradle plugin applied.

Scope-aware variant of collectAllModulePreviews that limits the aggregated result to previews whose @ComposePreviewLabOption(collectScopes = [...]) array contains scope.

Link copied to clipboard

Provides a delegate that collects @Preview functions from this module only.

Scope-aware variant of collectModulePreviews that limits the result to previews whose @ComposePreviewLabOption(collectScopes = [...]) array contains scope.

Link copied to clipboard

Removes duplicates from the aggregated preview list by CollectedPreview.id, warning via stdout when a duplicate is observed.

Link copied to clipboard

Sequence-shaped variant of distinctPreviewsById used by the compiler plugin's collectAllModulePreviews() IR rewrite. Walks previews once, yields each first occurrence by CollectedPreview.id in encounter order, and on the final next() == null step emits one warnDuplicatePreview line per id that collided two-or-more times.

Link copied to clipboard

Returns a Sequence that yields one CollectedPreview per element of factories, invoking each factory lambda the first time the corresponding element is requested.

Link copied to clipboard
fun PreviewLabPreview(id: String, displayName: String = id, filePath: String? = null, startLineNumber: Int? = null, endLineNumber: Int? = null, code: String? = null, kdoc: String? = null, content: @Composable () -> Unit): PreviewLabPreview

Create a CollectedPreview instance.

Link copied to clipboard
actual fun warnDuplicatePreview(message: String)
expect fun warnDuplicatePreview(message: String)

Emits a warning about duplicate preview ids to the platform's most discoverable warning surface. Used internally by distinctPreviewsById to surface cross-artifact same-FQN preview collisions; not part of the consumer-facing API.

actual fun warnDuplicatePreview(message: String)
actual fun warnDuplicatePreview(message: String)
actual fun warnDuplicatePreview(message: String)
actual fun warnDuplicatePreview(message: String)