say when it comes to building a button in a component library I have 2 (probably more) choices
<PrimaryButton /> or <Button primary /> if we go on the assumption I've built my own button component
I know perhaps it's a discretion decision and both have pros and cons. But for me primary buttons should have loading states and secondary buttons should not (as just one example).
With the second approach <Button secondary loading/> there is no way to not have loading show on the secondary button UNLESS you do conditional logic at the button level which I think is a part of a design smell.
Whereas defined as <PrimaryButton /> or <SecondaryButton /> you can define at the prop level.
I'm wondering if there is a good argument for doing the second approach over the former or if it's just a matter of preference.