Skip to content

tplkn/compose-theme-preview

Repository files navigation

Maven Central

This library provides ability tot preview your compose theme in few lines of code.

Usage

Using Gradle Groovy DSL

implementation 'me.teplyakov:compose-theme-preview:<last version>'

Using Gradle Kotlin DSL

implementation("me.teplyakov:compose-theme-preview:<last version>")

Widgets

Full theme preview

@Preview(heightDp = 1600)
@Composable
fun FullThemePreview() {
    YourTheme {
        ThemePreview()
    }
}

Important: use heightDp for @Preview annotation to adjust preview widget in IDE

Colors preview

@Preview
@Composable
fun ColorsThemePreview() {
    YourTheme {
        ColorsPreview()
    }
}

Typography preview

@Preview
@Composable
fun TypographyThemePreview() {
    YourTheme {
        TypographyPreview()
    }
}

Shapes preview

@Preview
@Composable
fun ShapesThemePreview() {
    YourTheme {
        ShapesPreview()
    }
}

Compatibility

Library Version Compose bom version
0.3.x 2023.03.00
0.2.x 2023.01.00
0.1.x 2022.12.00

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages