Avatar
Examples
To render an avatar, apply the class chi-avatar
to a div element and place an image inside.
Customizations
Web Component
Properties
Web component coming soon
Accessibility
Keyboard Navigation
Key | Function |
---|---|
Tab | Moves focus to the avatar element if it is interactive (e.g., a button or link). |
Shift + Tab | Moves focus to the previous focusable element if it is interactive. |
Enter ,Space | Activates the avatar action if it is a button or link. |
Esc | Closes any associated popovers or tooltips. |
For detailed keyboard interactions, refer to our Keyboard Control Guide.
Visit WebAIM for general keyboard techniques.
Explore live examples in the ARIA Practices Guide.
Resources
- Mozilla Resources for Developers: Information about the
img
role and accessible image usage. - W3C Decision Tree: A guide to choosing appropriate alt text for images.
Other recommendations
Find additional accessibility tips in our Accessibility Guide.
WCAG 2.2 Guidelines
- Non-text Content: Ensure all badges conveying information have a text alternative. (Level A)
- Info and Relationships: Maintain semantic structure for screen readers. (Level A)
- Headings and Labels: Ensure badges have meaningful labels. (Level AA)
- Labels or Instructions: Provide clear instructions for dismissible badges. (Level A)
- Name, Role, Value: Define ARIA attributes correctly for badges. (Level A)