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

Disclosure Component #6633

Closed
joshblack opened this issue Aug 6, 2020 · 7 comments
Closed

Disclosure Component #6633

joshblack opened this issue Aug 6, 2020 · 7 comments
Labels
epic Special label used by ZenHub for epic functionality type: enhancement 💡

Comments

@joshblack
Copy link
Contributor

joshblack commented Aug 6, 2020

We've seen a use-case crop up for a generic component that combines a trigger and a pop-up to enable a variety of use-cases. This primitive can be used by teams to build a variety of accessible functionality in their product.

At its core, this component would have two pieces:

  • A trigger that the user interacts with by clicking or using their keyboard to disclose the content of the component
  • A pop-up that contains the content

Depending on the type of content, it may be useful for the pop-up to contain a way to close the pop-up (like a X present in a modal). Similarly, focus may need to be placed on the first item for certain cases like in a dialog pattern.

In terms of focus order, the content in the pop-up should appear after the trigger. This means that a user can do the following:

  • Tab to the trigger
  • Press spacebar
  • Press tab to go into the content of the pop-up
  • Press tab to get out of the content of the pop-up (note: this does not dismiss the pop-up)

2021 Release:

@joshblack
Copy link
Contributor Author

As an example, GitHub uses this pattern across their site to drive the following parts of their experience:

Nav menus

image

Disclosure buttons

image

Branch switcher

image

This pattern includes nested components like a combobox and content switcher / tabs

Action buttons

For cases like sorting

image

Or filtering

image

@janhassel
Copy link
Member

Are there any plans on pursuing this? I've seen a lot of teams using an OverflowMenu to achieve such interfaces which mostly results in invalid HTML (by not using <li> as direct children of <ul>) and comes with considerable accessibility violations.

I think a component like this which would allow for a wider range of use cases is desperately needed.

@joshblack
Copy link
Contributor Author

@janhassel yes! 100%. I think the plan is to see if we can get it into the next sprint and tackle the exact case that you mentioned.

Let me know if you want to help out at all with it! Happy to loop you in on any conversations if you're interested 😄

@laurenmrice
Copy link
Member

laurenmrice commented Jan 25, 2021

Screen Shot 2021-01-25 at 1 12 13 PM

Screen Shot 2021-01-25 at 1 13 29 PM

Screen Shot 2021-05-14 at 12 26 20 AM

Screen Shot 2021-05-14 at 12 26 25 AM

Screen Shot 2021-05-14 at 12 26 30 AM

Screen Shot 2021-05-14 at 12 26 35 AM

Screen Shot 2021-05-14 at 12 28 53 AM

Screen Shot 2021-05-14 at 12 27 39 AM

Screen Shot 2021-05-14 at 12 28 28 AM

@joshblack joshblack mentioned this issue Jan 25, 2021
6 tasks
@joshblack
Copy link
Contributor Author

@janhassel just a heads up, we have a related component to this (Popover) that will be used in conjunction with the Disclosure component. Let me know if you want to help us test it out!

@laurenmrice
Copy link
Member

Design specs

Icon button

Disclosure — Icon button

Text

Disclosure — Text

Menus

Disclosure — Menus

Dismissable

Disclosure — Dismissable

@laurenmrice
Copy link
Member

laurenmrice commented May 14, 2021

Avatar example

Disclosure — Avatar

Text button example

Disclosure — Button with text

Disclosure — Combo button

Settings example

Disclosure — Settings

@joshblack joshblack added the epic Special label used by ZenHub for epic functionality label Jun 1, 2021
@joshblack joshblack changed the title Proposal: Disclosure component Disclosure Component Jun 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
epic Special label used by ZenHub for epic functionality type: enhancement 💡
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants