This library provides ability tot preview your compose theme in few lines of code.
Using Gradle Groovy DSL
implementation 'me.teplyakov:compose-theme-preview:<last version>'
Using Gradle Kotlin DSL
implementation("me.teplyakov:compose-theme-preview:<last version>")
@Preview(heightDp = 1600)
@Composable
fun FullThemePreview() {
YourTheme {
ThemePreview()
}
}
Important: use heightDp for @Preview annotation to adjust preview widget in IDE
@Preview
@Composable
fun ColorsThemePreview() {
YourTheme {
ColorsPreview()
}
}
@Preview
@Composable
fun TypographyThemePreview() {
YourTheme {
TypographyPreview()
}
}
@Preview
@Composable
fun ShapesThemePreview() {
YourTheme {
ShapesPreview()
}
}
Library Version | Compose bom version |
---|---|
0.3.x | 2023.03.00 |
0.2.x | 2023.01.00 |
0.1.x | 2022.12.00 |