PreviewLabEvent
data class PreviewLabEvent(val title: String, val description: String? = null, val createAt: Instant = Clock.System.now())
Represents an event that occurred during preview interaction
Captures user interactions and system events within the preview environment for debugging and analysis purposes. Events are displayed in the Events inspector tab with timestamps for tracking interaction sequences.
// Events are typically created through PreviewLabScope
PreviewLab {
Button(
onClick = { onEvent("Button clicked", "User tapped the submit button") }
) {
Text("Submit")
}
}
// Events automatically include timestamp
val event = PreviewLabEvent(
title = "Form submitted",
description = "User completed the registration form"
)Content copied to clipboard
Parameters
title
Brief event description displayed in the events list
description
Detailed event information (optional)
createAt
Timestamp when the event occurred (auto-generated)
See also
me.tbsten.compose.preview.lab.previewlab.PreviewLabScope.onEvent