Open joshblack opened 3 years ago
// Sample code snippet
Props
Name | Type | Description |
---|
Links & Resources
Question, how would we relate switchers like in this example:
ContentSwitcher checklist
GA
Next steps
Use cases
Here are some high level thoughts for our Monday discussion:
Content switcher let users toggle between different formatting, like with a grid view and a table view. They are also often used to narrow content groups of closely related information. The role of tabs in information hierarchy is to separate content. Tabs follow the metaphor for sections in a filing cabinet and two tabs wouldn’t contain the same sheet of paper. When it comes to content, tabs play a bigger part in information hierarchy while content switchers are more precise in the content/component they are paired with.
There are a few similar use cases. For instance, you could use both tabs or a content switcher within a card but it depends on the specific content being organized:
different view of same info:
content switcher
different category of same thing:
content switcher
or tabs
, depends on the visual hierarchy of the components and content around it
separate but related info:
tabs
(see this a lot with multiple data tables)
tabs | content switcher |
---|---|
distinct but still related content | alternate views of same content |
no overlapping content (sometimes can happen but if so, it's very specific to workflow) | usually has overlapping content or is the same content |
organizes a broader range content | organize specific content in context |
first hierarchically, can be more broad, stand alone | usually paired with other content or components |
organizes content to reduce cognitive load | narrow down choices or options to make a better decision |
ai apps icon switcher: https://pages.github.ibm.com/ai-applications/design/components/iconcontentswitcher/usage/
Backlog cleaning:
It currently fails the "tab pattern"
The
ContentSwitcher
component effectively uses the tab pattern under-the-hood in order to be operable. Unfortunately, the current API does not wire up everything that is needed for this pattern to function. In particular, it does not connect the currently selected "tab" with its corresponding "tabpanel".This issue is to update the
ContentSwitcher
API to correctly implement the ARIA Design Pattern for Tab: https://w3c.github.io/aria-practices/#tabpanel behind theenable-v11-release
feature flag. This work can optionally include refactoring the class-based component to a hook-based one, in an earlier stage, if it's helpful.Some potential APIs to consider: