PreviewLabGalleryWindows
Creates a desktop window application for previewing Compose components
Launches a JVM desktop application with PreviewLab interface in a native window. Provides full desktop integration with customizable window properties for interactive component development and testing.
// Basic desktop application
fun main() = application {
PreviewLabGalleryWindows(
previewList = myModule.PreviewList
)
}
// With file handler and featured files
fun main() = application {
PreviewLabGalleryWindows(
previewList = myModule.PreviewList,
openFileHandler = UrlOpenFileHandler("https://github.com/user/repo/blob/main"),
featuredFileList = myModule.FeaturedFileList,
)
}
// Custom window configuration
fun main() = application {
PreviewLabGalleryWindows(
previewList = myModule.PreviewList,
windowState = rememberWindowState(size = DpSize(1400.dp, 900.dp)),
title = "My Component Gallery",
)
}Parameters
Collection of previews to display in the interface
Handler for opening source files (optional)
Grouped file organization for navigation
PreviewLabGalleryState for managing gallery state
WindowState for managing window properties
Callback invoked when window close is requested
Whether the window is visible
Window title text
Window icon painter
Whether to remove window decorations
Whether the window background is transparent
Whether the window can be resized
Whether the window is enabled for user interaction
Whether the window can receive focus
Whether the window should stay on top of other windows
Content to display when no preview is selected
Configuration for the MCP server (experimental feature). The MCP server allows AI assistants to interact with previews. Use PreviewLabMcpServerConfig.Disable to disable the MCP server.
Callback for preview key events
Callback for key events