{"slug":"avatar","name":"Avatar","category":"Display & Misc","summary":"A circular identity image with initials and an optional presence dot.","status":"stable","since":"0.2.0","import":"import { Avatar } from '@elluzion/iv-ui';","usage":["`fallback` initials show when `src` is missing or fails to load.","Pass an empty `alt` for decorative avatars; otherwise `alt` names the person.","`status` adds a presence dot: neutral, success, error, info, or accent."],"props":[{"name":"src","type":"string","default":"''","description":"Image source. Falls back to `fallback` initials when missing or broken.","required":false,"bindable":false},{"name":"alt","type":"string","default":"''","description":"Accessible name for the image. Use an empty string for decorative avatars.","required":false,"bindable":false},{"name":"size","type":"AvatarSize","default":"'md'","description":"Control size.","required":false,"bindable":false},{"name":"fallback","type":"string","default":"''","description":"Initials shown when there is no image.","required":false,"bindable":false},{"name":"status","type":"AvatarStatus","default":null,"description":"Presence dot treatment.","required":false,"bindable":false},{"name":"className","type":"string","default":"''","description":"Extra classes merged onto the root element.","required":false,"bindable":false}],"events":[],"snippets":[{"name":"children","type":"Snippet","default":null,"description":"Custom avatar content replacing the image.","required":false,"bindable":false}],"types":[{"name":"AvatarSize","kind":"type","code":"type AvatarSize = 'xs' | 'sm' | 'md' | 'lg';","description":"Avatar diameter steps."},{"name":"AvatarStatus","kind":"type","code":"type AvatarStatus = 'neutral' | 'success' | 'error' | 'info' | 'accent';","description":"Presence dot treatments."}],"manual":[],"tokens":["--iv_accent","--iv_avatar-lg","--iv_avatar-md","--iv_avatar-sm","--iv_avatar-xs","--iv_border","--iv_error","--iv_foreground-dim","--iv_info","--iv_leading-none","--iv_radius-pill","--iv_spacing-sm","--iv_success","--iv_surface","--iv_surface-elevated","--iv_text-base","--iv_text-body-sm","--iv_text-sm","--iv_text-xs","--iv_weight-medium"],"cssHooks":["iv-accent","iv-avatar","iv-avatar-fallback","iv-avatar-img","iv-avatar-overlay","iv-avatar-status","iv-error","iv-info","iv-lg","iv-neutral","iv-sm","iv-success","iv-xs"],"accessibility":{"notes":["When the image is present, `alt` is its accessible name.","The initials fallback gets `role=\"img\"` and the same name when `alt` is set.","An empty `alt` makes the avatar decorative; use it when the name is already next to the avatar."]},"related":[{"title":"Badge","summary":"A compact label for status, counts, or categories.","url":"/components/badge","kind":"Component"},{"title":"Card","summary":"A bordered surface for grouped content and actions.","url":"/components/card","kind":"Component"},{"title":"Shortcut","summary":"Renders a keyboard combination as key caps.","url":"/components/shortcut","kind":"Component"},{"title":"EmptyState","summary":"Explains why an area has no content and offers the next step.","url":"/components/empty-state","kind":"Component"}],"examples":[{"id":"sizes","title":"Sizes","description":"`xs`, `sm`, `md`, and `lg` steps.","code":"<script lang=\"ts\">\n\timport { Avatar } from '@elluzion/iv-ui';\n</script>\n\n<div class=\"row\">\n\t<Avatar size=\"xs\" fallback=\"AL\" alt=\"Ada Lovelace\" />\n\t<Avatar size=\"sm\" fallback=\"GH\" alt=\"Grace Hopper\" />\n\t<Avatar fallback=\"AT\" alt=\"Alan Turing\" />\n\t<Avatar size=\"lg\" fallback=\"KJ\" alt=\"Katherine Johnson\" />\n</div>\n\n<style>\n\t.row {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: var(--iv_spacing-md);\n\t}\n</style>"},{"id":"fallback","title":"Fallback","description":"Initials are used when there is no image or the image fails.","code":"<script lang=\"ts\">\n\timport { Avatar } from '@elluzion/iv-ui';\n</script>\n\n<div class=\"row\">\n\t<Avatar fallback=\"AL\" alt=\"Ada Lovelace\" />\n\t<Avatar src=\"data:image/png;base64,invalid\" fallback=\"GH\" alt=\"Grace Hopper\" />\n\t<Avatar src=\"data:image/png;base64,invalid\" fallback=\"AT\" alt=\"Alan Turing\" />\n</div>\n\n<style>\n\t.row {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: var(--iv_spacing-md);\n\t}\n</style>"},{"id":"status","title":"Status","description":"A presence dot in the corner, with every status treatment.","code":"<script lang=\"ts\">\n\timport { Avatar } from '@elluzion/iv-ui';\n</script>\n\n<div class=\"row\">\n\t<Avatar fallback=\"AL\" alt=\"Ada Lovelace\" status=\"success\" />\n\t<Avatar fallback=\"GH\" alt=\"Grace Hopper\" status=\"error\" />\n\t<Avatar fallback=\"AT\" alt=\"Alan Turing\" status=\"info\" />\n\t<Avatar fallback=\"KJ\" alt=\"Katherine Johnson\" status=\"accent\" />\n\t<Avatar fallback=\"MH\" alt=\"Margaret Hamilton\" status=\"neutral\" />\n</div>\n\n<style>\n\t.row {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tgap: var(--iv_spacing-md);\n\t}\n</style>"}],"markdown":"/components/avatar.md","page":"/components/avatar"}