Package-level declarations

Types

Link copied to clipboard

Contains the default values used by PreviewLab.

Link copied to clipboard

The scope of the PreviewLab, which provides methods to create fields, handle events, and manage layout nodes.

Link copied to clipboard
class PreviewLabState(initialContentOffset: Offset = Offset.Zero, initialContentScale: Float = 1.0f, initialIsInspectorPanelVisible: Boolean = true, initialGridSize: Dp? = 40.dp)

Class that holds the state of PreviewLab. Mainly holds state values that have changed due to user interaction during debugging.

Functions

Link copied to clipboard

Finds a mutable field by its label in the PreviewLabState, throwing an error if not found.

Link copied to clipboard

Finds a mutable field by its label in the PreviewLabState.

Link copied to clipboard
fun PreviewLab(modifier: Modifier = Modifier, state: PreviewLabState = PreviewLabDefaults.state(), screenSizes: List<ScreenSize> = PreviewLabDefaults.screenSizes(), showScreenSizeField: Boolean = true, isHeaderShow: Boolean = PreviewLabDefaults.isHeaderShow(), inspectorTabs: List<InspectorTab> = PreviewLabDefaults.inspectorTabs(), contentRoot: @Composable (content: @Composable () -> Unit) -> Unit = PreviewLabDefaults.contentRoot(), enable: Boolean = PreviewLabDefaults.enable(), isInPreviewLabGalleryCardBody: Boolean = PreviewLabDefaults.isInPreviewLabGalleryCardBody(), contentGraphicsLayer: GraphicsLayer = PreviewLabDefaults.contentGraphicsLayer(), content: @Composable PreviewLabScope.() -> Unit)

PreviewLab is a powerful preview environment for Compose UI components that enables interactive development and testing. It provides dynamic field controls, event tracking, and multi-device previews to enhance the development experience.

fun PreviewLab(screenSize: ScreenSize, modifier: Modifier = Modifier, state: PreviewLabState = PreviewLabDefaults.state(), showScreenSizeField: Boolean = true, isHeaderShow: Boolean = PreviewLabDefaults.isHeaderShow(), inspectorTabs: List<InspectorTab> = PreviewLabDefaults.inspectorTabs(), contentRoot: @Composable (content: @Composable () -> Unit) -> Unit = PreviewLabDefaults.contentRoot(), enable: Boolean = PreviewLabDefaults.enable(), isInPreviewLabGalleryCardBody: Boolean = PreviewLabDefaults.isInPreviewLabGalleryCardBody(), contentGraphicsLayer: GraphicsLayer = PreviewLabDefaults.contentGraphicsLayer(), content: @Composable PreviewLabScope.() -> Unit)

Convenience overload for single screen size preview using a ScreenSize object.

fun PreviewLab(maxWidth: Dp, maxHeight: Dp, modifier: Modifier = Modifier, state: PreviewLabState = PreviewLabDefaults.state(), showScreenSizeField: Boolean = true, isHeaderShow: Boolean = PreviewLabDefaults.isHeaderShow(), inspectorTabs: List<InspectorTab> = PreviewLabDefaults.inspectorTabs(), contentRoot: @Composable (content: @Composable () -> Unit) -> Unit = PreviewLabDefaults.contentRoot(), enable: Boolean = PreviewLabDefaults.enable(), isInPreviewLabGalleryCardBody: Boolean = PreviewLabDefaults.isInPreviewLabGalleryCardBody(), contentGraphicsLayer: GraphicsLayer = PreviewLabDefaults.contentGraphicsLayer(), content: @Composable PreviewLabScope.() -> Unit)

Convenience overload for single screen size preview.

Link copied to clipboard

URLパラメータからPreviewLabStateを初期化するComposable関数。 contentScaleなどの状態をURLパラメータから復元する。