Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generic/Custom Showkase Annotation #381

Open
eddnav opened this issue Apr 22, 2024 · 1 comment
Open

Generic/Custom Showkase Annotation #381

eddnav opened this issue Apr 22, 2024 · 1 comment

Comments

@eddnav
Copy link

eddnav commented Apr 22, 2024

Why can't we have a single annotation like Showkase for all the UI elements? Why did you create a different annotation for each UI element(@ShowkaseComposable for composables, @ShowkaseColor for colors & @ShowkaseTypography for text styles)?
This was done mostly for future proofing. Even though these annotations have the same properties right now, it's possible that they will diverge as we add more features. Once more people start using this library, we will get a more clear idea about whether that needs to happen or not. If we find that it didn't evolve the way we expected, we will consider consildating these annotations.

I understand the decision behind specific annotations for each type, but it would be nice to also have a custom (can behave just like @ShowkaseComposable, just not grouped under "Components") annotation to allow more flexibility. An example of this is shadows. My design system has custom drop shadows, not elevation and I would like to display them in Showkase.

@vinaygaba
Copy link
Collaborator

vinaygaba commented May 22, 2024

@eddnav My current thinking on this subject is that we should probably prefer keeping the API surface simple as long as there's a reasonable way to accomplish what a developers is trying to do. Everything in a design system can be exposed as part of a component preview itself and that should accomplish what you are hoping to get out of it. For example, one could create a preview like this to demonstrate the shadows

@ShowkaseComposable(name= "High", group = "Shadows")
@Preview
fun HighShadow() {
    Box(
        modifier = Modifier.size(64.dp).shadow(CustomTheme.shadows.high)
    ) {...}
}

If you squint enough, everything can be a component preview and this is true even for annotations like @ShowkaseColor and @ShowkaseTypography. Hope this makes sense

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants