primer / react

An implementation of GitHub's Primer Design System using React
https://primer.style/guides/react
MIT License
3.12k stars 533 forks source link

Button state selected #1783

Closed YousefED closed 2 years ago

YousefED commented 2 years ago

How do I use the React components to show a button as Selected?

With the CSS Primer, this is demonstrated here: https://primer.style/css/components/buttons#selected

image

mperrotti commented 2 years ago

We don't currently have a way to do this.

@pksjce - this is something to consider with the work you're doing on buttons right now

siddharthkp commented 2 years ago

Hi @YousefED, (just curious) where do you use this pattern?

YousefED commented 2 years ago

Hi!

I'm using it in this example: https://github.com/YousefED/Matrix-CRDT/tree/main/examples/rich-text-tiptap

For now, I've worked around it by using the Primer CSS library (but I'd prefer to use the React components)

On Tue, Jan 11, 2022 at 8:33 AM Siddharth Kshetrapal < @.***> wrote:

Hi @YousefED https://github.com/YousefED, (just curious) where do you use this pattern?

— Reply to this email directly, view it on GitHub https://github.com/primer/react/issues/1783#issuecomment-1009670472, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAC2BWNAGSARS4VQ6Q64YLDUVPMOPANCNFSM5LT3OFFA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

pksjce commented 2 years ago

We didn't consider it originally. Though the solution seems to be just to add background and box shadow, do some testing and push it both for Button and Button2

gaknoll commented 2 years ago

@YousefED we have decided to add a new component to our backlog called SegmentedControl that will support your desired use case. We have a number of other components prioritized ahead of this, but in the meantime you can continue to use your Primer CSS workaround. Thanks for taking the time to share your request with us! 🙏🏽