
- Location:
sabo/src/components/ui/avatar.tsx
When to use
- Display user or entity images with a built‑in fallback (initials/icon).
- Use in lists, headers, comments, or profile menus.
Usage
sabo/src/components/ui/avatar.tsx
Key props
Image URL. If it fails to load, the fallback is shown.
Accessible alternative text describing the user/image.
Use Tailwind to change size (
size-6, size-10), ring, or border.This component forwards all props from Radix Avatar primitives (Root/Image/Fallback). Above are commonly used props. For the full API, see Radix docs: https://www.radix-ui.com/primitives/docs/components/avatar
Styling tip
- Add a ring:
className=“ring-2 ring-primary”onAvatar. - Use aspect‑square containers;
Avataris circular by default.
Accessibility
- Always set meaningful
altonAvatarImage. - Provide visible labels nearby for context (name/role).