Links Component
Contributed by Heran Wang
Links component navigates users to other web content.
Basic Links Component
Code Usage
Usability
- Mouse Hover Effect: We introduced a text underline decoration and a pointer cursor on hover to clearly signify that it is a clickable link, enhancing its usability.
- Focus Style: We added a focus style so that when users navigate using a keyboard (e.g., tabbing through elements), they can clearly identify which link is currently focused, making the navigation process more user-friendly.
Accessibility
- ARIA Label and Role: We incorporated an
aria-label
attribute and arole
attribute to the link. Thearia-label
provides additional information for screen reader users, while therole
attribute explicitly states the role of the element, enhancing its accessibility. - Title Attribute: We added a title attribute, which offers supplementary information that can be displayed as a tooltip when the mouse hovers over the link, enhancing the informational aspect of the link for all users.
Through these enhancements, we have augmented the usability and accessibility of the link, making it more friendly and inclusive, whether the user is interacting through a mouse, a keyboard, or a screen reader.
Enhanced Links Component
Code Usage
Usability
-
Dynamic Icon: We incorporated a right-arrow icon and added a small animation to it during hover. This animation can attract users' attention and hint at them that it's clickable, thus enhancing the link's usability through a visual and interactive cue.
-
Quick Access through Keyboard: We introduced an
accesskey
attribute to the link, allowing users to quickly access the link through a keyboard shortcut, in this case, the "r" key, making navigation more streamlined and user-friendly.
Accessibility
-
Focus Style: We retained the focus style from the previous iteration, aiding keyboard users in clearly identifying the currently focused link, therefore facilitating easier navigation.
-
ARIA Attributes and Icon Hiding: We added the
aria-hidden="true"
attribute to the arrow icon, meaning screen readers will ignore this icon as it is primarily designed for visual users and doesn't convey actual information, ensuring that the necessary information is communicated clearly without distractions. -
Tab Index: We incorporated a
tabindex="0"
attribute to ensure that the link is accessible smoothly via the Tab key on the keyboard, promoting better accessibility for keyboard users.
Through the aforementioned improvements, we have further elevated the usability and accessibility of the link, making it not only user-friendly and accessible but also more appealing and innovative.
Expand Links Component
Code Usage
Usability
-
Ease of Use: The interface is minimalistic, which means it's intuitive to interact with. With just a single button to toggle the visibility of the content, the user experience is straightforward and user-friendly.
-
Efficient Interaction: A one-click action is all that's needed to show or hide additional content. This ensures that the interaction is quick and non-disruptive, fitting seamlessly into the user's workflow.
-
Clear Visual Cues: The downward and upward arrows (
⬇
and⬆
) serve as clear indicators of what will happen when the button is clicked. The text of the button also dynamically changes between "Read more" and "Read less," offering further visual guidance. -
Instant Feedback: As soon as the user clicks the button, the content expands or collapses immediately, delivering instant feedback.
Accessibility
-
Keyboard Navigability: Our design is keyboard-friendly. Users can navigate to the button and activate it using keyboard inputs, thus making the feature accessible to those who rely on keyboard navigation.
-
Dynamic ARIA Attributes: We've employed ARIA attributes such as
aria-hidden
for the icons, and you can further addaria-expanded
to indicate the current state of the content—either expanded or collapsed. This makes the component more accessible to users utilizing screen readers. -
High-Contrast Text: The text is displayed in colors that are easy to distinguish against their backgrounds, providing a better experience for users with visual impairments.
-
Simple and Direct Language: The language used for the button is simple— "Read more" and "Read less." This makes it easier to understand and also facilitates translation if necessary.
Version
Version | Editor | Author | Date | Description |
---|---|---|---|---|
v1.0 | Heran Wang | Heran Wang | 27/AUG/2023 | Initial version |
v2.0 | Heran Wang | Heran Wang | 07/SEP/2023 | Basic version |
v3.0 | Heran Wang | Heran Wang | 14/SEP/2023 | Enhanced version |
v3.1 | Heran Wang | Heran Wang | 04/OCT/2023 | Full version |
v4.0 | Heran Wang | Heran Wang | 04/OCT/2023 | Verify updates |
v5.0 | Heran Wang | Heran Wang | 09/OCT/2023 | Expand version |