-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Milestone
Description
Task Description ✏️
Implement the Avatar component as part of the design system epic #40.
Avatar provides a consistent way to display user profile images, initials, or icons. It will consume theme tokens for colors, spacing, and sizing, and support different shapes, fallback content, and optional ring outlines.
Acceptance Criteria ✅
-
Avatarcomponent implemented usingstyled(Box)orstyled(View)as the base. - Supports
srcandsrcSetprops for image display. - Supports
altprop applied to the underlyingimgelement for accessibility. - Supports
childrenfor fallback text or icon rendering when no image is provided. - Supports
imgPropsto pass attributes/events to theimgelement (e.g. error handling). - Supports
variantprop (circular,rounded,square, string) mapped to theme tokens for border radius. - Supports optional
ringprop with configurableringColorusing theme tokens (e.g.{ outlineWidth, outlineColor, outlineOffset, outlineStyle }). - Supports
sizeprop (small,medium,large) mapped to theme sizing tokens. - No raw CSS values — all styles derived from theme tokens.
- Unit tests verify image rendering, fallback children, alt text, variant shapes, and ring styles.
- Storybook stories demonstrate image, fallback, variants, sizes, and ring outline states.
- Code passes linting, typing, and CI checks.
Dependencies 🔗
No response
Definition of Ready (DoR) 📋
Task is independent and scoped to the Avatar component.
- Base primitive and theme tokens are implemented and available.
- Props to be supported by Avatar are agreed upon (
src,srcSet,alt,children,imgProps,variant,ring,size).
Definition of Done (DoD) 🏁
-
Avatarcomponent implemented with all props working correctly. - Image, fallback, variant shapes, size, and ring outline render correctly.
- Unit tests cover all states and props.
- Storybook stories demonstrate all variations.
- Code reviewed, linted, typed, and passes CI checks.
- Documentation updated in Storybook for Avatar usage.
- Component is ready for reuse across the design system.
Additional Notes or Resources 📎
- MDN Docs on
imgelement: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img
Custom ring style, e.g. highlight color or outline. Example: { outlineWidth: "2px", outlineColor: "colorPalette.500", outlineOffset: "2px", outlineStyle: "solid" }