Is there any strong opinion for Compose components...
# naming
r
Is there any strong opinion for Compose components to be named like
PrimaryButton / SecondaryButton
instead of
ButtonPrimary / ButtonSecondary
?
j
I think it is more related to be able to discover them easily, if it is not a problem for your team I don’t think it is an issue
l
If in doubt,
PrimaryButtonPrimary
🤣 5
a
ButtonPrimary is easily discoverable compared to PrimaryButton, but thats only the case if you also happen to have PrimarySwitch, PrimaryCheckbox, and PrimarySomethingElse. Other than that, just go with what works for you
c
reminds me of the
btn_dooFlab
days of VB 5 😂 - I'd totally understand
ButtonPrimary
but would totally prefer
PrimaryButton
. I think in most real life situations, if I was coming to your codebase as a new developer tasked with adding a primary button to a piece of new or existing UI, I'd look at how it was done elsewhere and would stumble across an example.