Switch labels in Data Grid #3843
-
Hey Paste team, Are switch labels required in the context of a data grid? I'm exploring a UI that allows users to make the same configuration to every row in that data grid, and i'm wondering if there are any accessibility issues with having the column header in the top row with just the switch component in each of the row cells? the label gets pretty repetitive and we're expecting the table to have 20+ rows in this table, so trying to find ways to make it less visually crowded figma for reference |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Disclaimer: This is a very experimental bot using OpenAI's GPT-4. The answers may not be correct, a human will review the answer and update it if necessary. Hey there! For your UI design in a Data Grid that includes a switch component in each row, it's important to maintain accessibility. According to the Paste documentation, when using the Switch component, the label text should not change based on the state of the Switch. This implies that each Switch should have a label for clarity and accessibility purposes, even within a Data Grid. However, the documentation also suggests that tables and by extension, Data Grids, should aim to reduce visual repetition and maintain clarity for all users, including those using screen readers. Given your concern about the visual clutter of repetitive labels in a Data Grid with many rows, one approach could be to ensure the column header clearly describes the action or configuration the switches control, thus serving as a sort of "global" label. Additionally, for screen reader users, you might consider using visually hidden text to provide context for each switch, ensuring that the purpose of the switch is clear even without the visual cues. Here's a snippet from the documentation regarding providing clear actions while reducing visual repetition, adapted for your scenario: // Example of using Screen Reader Only component to hide repetitive labels visually
import {ScreenReaderOnly} from '@twilio-paste/core/screen-reader-only';
import {Switch} from '@twilio-paste/core/switch';
<Switch>
<ScreenReaderOnly>Enable Feature X for {rowItemName}</ScreenReaderOnly>
</Switch> This way, you maintain accessibility by providing necessary context to assistive technologies while reducing visual clutter for sighted users. For more details on the Switch component and accessibility considerations, you can visit the Switch documentation. Remember, the key is to balance visual simplicity with accessibility needs, ensuring that all users, regardless of how they interact with your UI, have a clear understanding of what each control does. If you have further questions or need more specific guidance, feel free to reach out! I also did a search, and I managed to find these other Discussions that might be similar or related to your question. Give them a read to see if they answer your question. If they do, head back here and update this discussion and mark it as answered, pointing others to the related discussion:
|
Beta Was this translation helpful? Give feedback.
-
@char-mainewang You can follow PasteBot's guidance here, where the column header can act as a global label for all the Switches in the column. |
Beta Was this translation helpful? Give feedback.
Disclaimer: This is a very experimental bot using OpenAI's GPT-4. The answers may not be correct, a human will review the answer and update it if necessary.
Hey there!
For your UI design in a Data Grid that includes a switch component in each row, it's important to maintain accessibility. According to the Paste documentation, when using the Switch component, the label text should not change based on the state of the Switch. This implies that each Switch should have a label for clarity and accessibility purposes, even within a Data Grid. However, the documentation also suggests that tables and by extension, Data Grids, should aim to reduce visual repetition and maintain clarity for all us…