@@ -23,22 +23,17 @@ def avatar(
2323 class_ : str | None = None ,
2424 ** attrs ,
2525) -> Renderable :
26- """
27- Basecoat-style avatar component.
28-
29- Based on Basecoat UI avatar implementation.
30- Note: Basecoat doesn't have a dedicated avatar component,
31- this uses standard img elements with avatar styling.
26+ """Render an image avatar with Basecoat sizing tokens.
3227
3328 Args:
34- src: Image source URL
35- alt: Image alt text
36- size: Avatar size
37- class_: Additional CSS classes
38- **attrs: Additional HTML attributes
29+ src: Image source URL.
30+ alt: Alt text describing the avatar.
31+ size: Size token mapping to Tailwind `` size-*`` classes.
32+ class_: Extra CSS classes appended to the ``img`` element.
33+ **attrs: Additional HTML attributes forwarded to the ``img`` tag.
3934
4035 Returns:
41- htpy.img: Avatar image element
36+ Renderable: Configured ``<img>`` node.
4237 """
4338
4439 # Base classes - following basecoat avatar styling
@@ -63,13 +58,16 @@ def avatar(
6358def avatar_text (
6459 initials : str , * , size : AvatarSize = "md" , class_ : str | None = None , ** attrs
6560) -> Renderable :
66- """Render an initials avatar ( fallback) as a centered rounded span.
61+ """Render an initials avatar fallback as a rounded ``< span>`` .
6762
6863 Args:
69- initials: Text to show inside the avatar (e.g. "CN")
70- size: Avatar size key (xs, sm, md, lg, xl)
71- class_: Extra classes to append
72- **attrs: Additional attributes for the span
64+ initials: Text or initials displayed inside the avatar.
65+ size: Size token controlling the diameter.
66+ class_: Extra CSS classes appended to the span.
67+ **attrs: Additional HTML attributes forwarded to the span.
68+
69+ Returns:
70+ Renderable: Styled ``<span>`` element with initials.
7371 """
7472
7573 base = f"{ _size_classes [size ]} shrink-0 bg-muted flex items-center justify-center rounded-full text-sm font-medium"
@@ -90,9 +88,18 @@ def avatar_group(
9088 hover_expand : bool = False ,
9189 class_ : str | None = None ,
9290) -> Renderable :
93- """Render a stacked avatar group .
91+ """Render overlapping avatar images with optional rings and hover expansion .
9492
95- images may be list of src strings or AvatarImage dictionaries with src and alt.
93+ Args:
94+ images: List of avatar URLs or ``AvatarImage`` dicts with ``src``/``alt``.
95+ size: Size token applied to each child avatar.
96+ ring: Whether to render rings (via ``ring-2``) around each avatar.
97+ grayscale: Whether to desaturate avatars.
98+ hover_expand: Whether to animate spacing on hover.
99+ class_: Extra CSS classes appended to the container ``div``.
100+
101+ Returns:
102+ Renderable: Stacked avatar ``<div>`` containing ``<img>`` children.
96103 """
97104 selectors = []
98105 # ring styles applied to child imgs
0 commit comments