Companion

PreviewLab companion object with default settings.

This provides the most common way to use PreviewLab with sensible defaults:

  • State persistence using rememberSaveable

  • Smartphone and desktop screen sizes

  • No custom content wrapper

Most preview functions will use this default instance:

@Preview
@Composable
private fun MyPreview() = PreviewLab {
// Preview content with interactive fields
}

Equivalent to creating: PreviewLab() with default parameters.

Functions

Link copied to clipboard
open operator fun invoke(modifier: Modifier = Modifier, state: PreviewLabState = defaultState(), screenSizes: List<ScreenSize> = defaultScreenSizes, isHeaderShow: Boolean = this.defaultIsHeaderShow(), inspectorTabs: List<InspectorTab> = this.defaultInspectorTabs(), isInPreviewLabGalleryCardBody: Boolean = LocalIsInPreviewLabGalleryCardBody.current, contentGraphicsLayer: GraphicsLayer = rememberGraphicsLayer(), content: @Composable PreviewLabScope.() -> Unit)

Main entry point for PreviewLab that enables interactive preview development with dynamic controls.

operator fun invoke(maxWidth: Dp, maxHeight: Dp, modifier: Modifier = Modifier, state: PreviewLabState = defaultState(), isHeaderShow: Boolean = this.defaultIsHeaderShow(), inspectorTabs: List<InspectorTab> = this.defaultInspectorTabs(), isInPreviewLabGalleryCardBody: Boolean = LocalIsInPreviewLabGalleryCardBody.current, contentGraphicsLayer: GraphicsLayer = rememberGraphicsLayer(), content: @Composable PreviewLabScope.() -> Unit)

Convenience overload for single screen size preview.