Skip to content
Razor catalogue

On this page

@addTagHelper *, Webority.Ui.Razor

Initials

Show a person's initials when there is no photo, always passing the name so the face is never blank.

Initials from a name
Show code
<app-avatar name="Jane Doe" />
<app-avatar name="Ravi" />
<app-avatar name="Server Room" />

Photo

Add a profile photo when there is one; it loads over the initials, which stay as the fallback.

A profile photo
Jane Doe
Show code
<app-avatar src="photoUrl" name="Jane Doe" />
A photo that fails to load
The initials show alone; the name stays readable to screen readers.
Jane Doe
Show code
<app-avatar src="brokenUrl" name="Jane Doe" />

In context

Place an avatar beside a name in a list or a header, so the person reads at a glance.

Avatar beside a name
Jane Doe
Jane Doe
Reviewer
Show code
<div class="d-flex align-items-center gap-2">
    <app-avatar src="photoUrl" name="Jane Doe" />
    <div>
        <div class="fw-semibold">Jane Doe</div>
        <div class="text-body-secondary wui-text-sm">Reviewer</div>
    </div>
</div>

Sizes

Use a preset from xs to 2xl for most places, or a pixel size when a layout needs an exact figure.

Preset sizes and a custom one
Show code
<app-avatar name="Jane Doe" size="AppAvatarSize.Xs" />
<app-avatar name="Jane Doe" size="AppAvatarSize.Sm" />
<app-avatar name="Jane Doe" />
<app-avatar name="Jane Doe" size="AppAvatarSize.Lg" />
<app-avatar name="Jane Doe" size="AppAvatarSize.Xl" />
<app-avatar name="Jane Doe" size="AppAvatarSize.TwoXl" />
<app-avatar name="Jane Doe" size-px="72" />

Colour and shape

Pick a semantic tone, or auto for a stable colour per person, and choose a circle, rounded or square shape.

Semantic tones
Show code
<app-avatar name="Jane Doe" tone="Primary" />
<app-avatar name="Jane Doe" tone="Success" />
<app-avatar name="Jane Doe" tone="Warning" />
<app-avatar name="Jane Doe" tone="Info" />
<app-avatar name="Jane Doe" tone="Neutral" />
Auto colour per person
Show code
<app-avatar name="Jane Doe" tone="Auto" />
<app-avatar name="Ravi Kumar" tone="Auto" />
<app-avatar name="Mia Chen" tone="Auto" />
<app-avatar name="Omar Ali" tone="Auto" />
<app-avatar name="Lena Novak" tone="Auto" />
Shapes, and a ring
Jane Doe Jane Doe Jane Doe Jane Doe
Show code
<app-avatar src="photoUrl" name="Jane Doe" shape="Circle" />
<app-avatar src="photoUrl" name="Jane Doe" shape="Rounded" />
<app-avatar src="photoUrl" name="Jane Doe" shape="Square" />
<app-avatar src="photoUrl" name="Jane Doe" ring="true" />

Presence and badges

Mark availability with a status dot, and count unread items with a corner badge.

Presence dots
Jane Doe Jane Doe Jane Doe Jane Doe
Show code
<app-avatar src="photoUrl" name="Jane Doe" status="Online" />
<app-avatar src="photoUrl" name="Jane Doe" status="Away" />
<app-avatar src="photoUrl" name="Jane Doe" status="Busy" />
<app-avatar src="photoUrl" name="Jane Doe" status="Offline" />
AppIcon face and a badge
Jane Doe3 9+
Show code
<app-avatar icon="user" size="AppAvatarSize.Lg" />
<app-avatar src="photoUrl" name="Jane Doe" size="AppAvatarSize.Lg" badge="3" />
<app-avatar name="Ravi Kumar" tone="Auto" size="AppAvatarSize.Lg" badge="9+" />

Clickable

Make an avatar a link when tapping it should open that person's profile.

An avatar that links to a profile
Show code
<app-avatar src="photoUrl" name="Jane Doe" href="/people/jane" label="Jane Doe" size="AppAvatarSize.Lg" />
<app-avatar name="Ravi Kumar" tone="Auto" href="/people/ravi" label="Ravi Kumar" size="AppAvatarSize.Lg" />

Every option

Every value of every prop, one cell each.

name

name="Jane Doe"
no name (bare "?")

src

src="photoUrl"
Jane Doe
src="" (empty string, falls back to initials)
src="brokenUrl" (falls back to initials)
Jane Doe

size

size="xs"
size="sm"
size="md" (default)
size="lg"
size="xl"
size="2xl"
size="72"

shape

shape="circle" (default)
shape="rounded"
shape="square"

tone

tone="primary" (default)
tone="neutral"
tone="success"
tone="warning"
tone="danger"
tone="info"
tone="auto"

status

status="none" (default)
status="online"
status="offline"
status="away"
status="busy"

ring

ring="false" (default)
ring="true"

label

label="Jane Doe, Reviewer" (tooltip on hover or focus)

icon

icon="user"
icon="user" + src (icon stays behind the photo)
Profile photo
icon={node} (React only, drawn as given)

iconVariant

icon-variant="linear" (default)
icon-variant="outline"
icon-variant="bold"
icon-variant="bulk"
icon-variant="broken"
icon-variant="twotone"

badge

badge="3"
3
badge="9+"
9+
badge={node} (React only, drawn as given)

href

href="#" (renders a link)
href="#" + label (label is the accessible name)

onClick

onClick={fn}, no href (React only, renders a button)

linkComponent

linkComponent={Link} with href (React only, the router link gets to)

tooltip

tooltip="Jane Doe, Reviewer" (hover or focus to see it)

tooltipPlacement

tooltip-placement="auto" (default)
tooltip-placement="top"
tooltip-placement="bottom"
tooltip-placement="start"
tooltip-placement="end"

className

class="..." (adds classes to the avatar, no visible change)

photoLabel

photo-label="Photo of Jane Doe" (read by screen readers, no visible change)

Guidance

What to do, and what to avoid.

Use it when

  • You are showing who a person is, such as a topbar account, a comment author or a team-list row.
  • A list of people needs a compact, recognisable identity marker.
  • A photo may be missing and you still want a stable, on-brand placeholder.

Reach for something else when

  • You need a status marker, not a person. → AppStatusBadge
  • It is a decorative or brand image, not a person. → a plain <img>
  • You are showing a company logo. → AppImagePicker

Always pass a name

Do

A name is always supplied, so the avatar shows meaningful initials and correct alt text.

Avoid

With no name and no photo the avatar can only render a bare question mark, which is useless to the eye and to a screen reader.

Beside the name it shows

Do
Ravi KumarRavi Kumar

The avatar sits next to the name it represents, so identity reads as one unit.

Avoid

On its own the avatar names no one, so the reader cannot tell whose row it is.

Use AppAvatar, not a plain image

Do

AppAvatar keeps the shared shape and falls back to initials when the photo is missing.

Avoid
Ravi

A hand-rolled round <img> drifts from the shared avatar shape and skips the initials fallback.

Reference

Try every prop, read the full list, and check keyboard and screen reader behaviour.

(none) ok broken
xs sm md lg xl 2xl
circle rounded square
primary neutral success warning danger info auto
none online offline away busy
aave activity add add-circle add-square additem airdrop airplane airplane-square airpod airpods alarm alert-circle alert-triangle align-bottom align-horizontally align-left align-right align-top align-vertically android ankr apple aquarius archive archive-add archive-book archive-box archive-minus archive-slash archive-tick arrange-horizontal arrange-horizontal-circle arrange-horizontal-square arrange-vertical arrange-vertical-circle arrange-vertical-square arrow arrow-circle-down arrow-circle-down-2 arrow-circle-left arrow-circle-left-2 arrow-circle-right arrow-circle-right-2 arrow-circle-up arrow-circle-up-2 arrow-down arrow-down-2 arrow-down-3 arrow-down-up arrow-forward arrow-forward-square arrow-left arrow-left-2 arrow-left-3 arrow-right arrow-right-2 arrow-right-3 arrow-rotate-left arrow-rotate-right arrow-square arrow-square-down arrow-square-left arrow-square-right arrow-square-up arrow-swap-horizontal arrow-swap-vertical arrow-up arrow-up-2 arrow-up-3 arrow-up-right at attach-circle attach-square audio-square augur autobrightness autonio avalanche award back back-square backward backward-10-seconds backward-15-seconds backward-5-seconds backward-item badge-check bag bag-2 bag-cross bag-cross-1 bag-happy bag-tick bag-tick-2 bag-timer ban bank barcode battery-charging battery-disable battery-empty battery-empty-1 battery-full be bell bezier bill binance-coin binance-usd bitcoin bitcoin-card bitcoin-convert bitcoin-refresh blend blend-2 blogger bluetooth bluetooth-2 bluetooth-circle bluetooth-rectangle blur bolt book book-1 book-saved book-square bookmark bookmark-2 bootstrap box box-1 box-2 box-add box-remove box-seam box-search box-tick box-time briefcase briefcase-cross briefcase-tick briefcase-timer brifecase-cross brifecase-tick brifecase-timer brodcast broom brush brush-2 brush-3 brush-big brush-square bubble bucket bucket-circle bucket-square bug building building-2 building-3 building-4 buildings buildings-2 buliding bullseye bus buy-crypto cake calculator calendar calendar-1 calendar-2 calendar-add calendar-check calendar-circle calendar-dots calendar-edit calendar-remove calendar-search calendar-tick call call-add call-calling call-incoming call-minus call-outgoing call-received call-remove call-slash camera camera-slash candle candle-2 car card card-add card-coin card-edit card-pos card-receive card-remove card-remove-1 card-send card-slash card-tick card-tick-1 cardano cards cash-stack category category-2 cd celo celsius chainlink chart chart-1 chart-2 chart-21 chart-circle chart-column chart-fail chart-square chart-success chat chat-dots check check-check check-circle chemical-glass chevron-down chevron-left chevron-right chevron-up chevrons-left chevrons-right chevrons-up-down chrome circle circle-help civic clipboard clipboard-check clipboard-close clipboard-export clipboard-import clipboard-text clipboard-tick clock close-circle close-square cloud cloud-add cloud-change cloud-connection cloud-cross cloud-drizzle cloud-fog cloud-lightning cloud-minus cloud-notif cloud-plus cloud-remove cloud-snow cloud-sunny code code-1 code-circle coffee coin coin-1 coins color-swatch colorfilter colors-square command command-square comment component computing contact convert convert-3-d-cube convert-card convertshape convertshape-2 copy copy-success copyright courthouse cpu cpu-charge cpu-setting creative-commons credit-card crop crown crown-1 cup cursor cut dai danger dash data data-2 decred dent designtools device-message devices diagram diagram-3 diamonds direct direct-down direct-inbox direct-left direct-normal direct-notification direct-right direct-send direct-up directbox-default directbox-notif directbox-receive directbox-send discount-circle discount-shape discover dislike display document document-cloud document-code document-code-2 document-copy document-download document-favorite document-filter document-forward document-like document-previous document-sketch document-text document-text-1 document-upload dollar-circle dollar-square download dribbble driver driver-2 driver-refresh driving drop dropbox edit edit-2 educare electricity element element-2 element-3 element-4 element-equal element-plus emercoin emoji-happy emoji-normal emoji-sad emoji-smile empty-wallet empty-wallet-add empty-wallet-change empty-wallet-remove empty-wallet-tick empty-wallet-time enjin-coin eos eraser eraser-square ethereum ethereum-classic export export-circle export-curve export-square external-drive external-link eye eye-off eye-slash facebook factory fatrows favorite-chart figma figma-1 file-plus-2 file-text files filter filter-add filter-edit filter-remove filter-search filter-square filter-tick finger-cricle finger-scan firstline flag flag-2 flame flash flash-circle flash-slash flashy folder folder-2 folder-add folder-cloud folder-connection folder-cross folder-favorite folder-kanban folder-minus folder-open folder-plus forbidden forbidden-2 format-circle format-square forward forward-10-seconds forward-15-seconds forward-5-seconds forward-item framer ftx-token gallery gallery-add gallery-edit gallery-export gallery-favorite gallery-import gallery-remove gallery-slash gallery-tick game gameboy gas-station gauge gemini gemini-2 ghost gift github glass global global-edit global-refresh global-search globe globe2 google google-drive google-play gps gps-slash grammerly graph grid grid-1 grid-2 grid-3 grid-4 grid-5 grid-6 grid-7 grid-8 grid-9 grid-edit grid-eraser grid-lock hamberger-menu hamburger-menu hand happyemoji hard-hat harmony hashtag hashtag-down hashtag-square hashtag-up headphone headphones health heart heart-add heart-circle heart-edit heart-remove heart-search heart-slash heart-tick hedera-hashgraph hex hierarchy hierarchy-2 hierarchy-3 hierarchy-square hierarchy-square-2 hierarchy-square-3 history home home-2 home-3 home-hashtag home-trend-down home-trend-up home-wifi hospital house house-2 html-3 html-5 huobi-token i-24-support i-3-d-cube-scan i-3-d-rotate i-3-d-square i-3-dcube i-3-square icon illustrator image import import-circle import-curve import-square inbox info info-circle information instagram iost java-script js judge kanban key key-square keyboard keyboard-open kyber-network lamp lamp-charge lamp-on lamp-slash language-circle language-square layer layout-dashboard layout-grid layout-maximize level lifebuoy lightbulb like like-1 like-dislike like-shapes like-tag link link-1 link-2 link-21 link-circle link-square linkedin list litecoin location location-add location-cross location-discover location-minus location-slash location-tick lock lock-1 lock-circle lock-slash log-out login login-curve logout logout-curve lovely magic-star magicpen mail main-component maker man map map-1 map-pin mask mask-left mask-right math maximize maximize-1 maximize-2 maximize-3 maximize-4 maximize-circle medal medal-star menu menu-board message message-2 message-add message-add-1 message-circle message-edit message-favorite message-minus message-notif message-programming message-question message-remove message-search message-square message-text message-text-1 message-tick message-time messages messages-1 messages-2 messages-3 messenger microphone microphone-2 microphone-slash microphone-slash-1 microscope microsoft milk mini-music-sqaure minus minus-circle minus-cirlce minus-square mirror mirroring-screen mobile mobile-programming monero money money-2 money-3 money-4 money-add money-archive money-change money-forbidden money-receive money-recive money-remove money-send money-tick money-time moneys monitor monitor-mobbile monitor-recorder moon more more-2 more-circle more-horizontal more-square mouse mouse-circle mouse-square music music-circle music-dashboard music-filter music-library-2 music-play music-playlist music-square music-square-add music-square-remove music-square-search musicnote nebulas nem nexo next note note-1 note-add note-favorite note-remove note-square note-text notepad notepad-2 notification notification-1 notification-bing notification-circle notification-favorite notification-status ocean-protocol okb okru omega-circle omega-square ontology paintbucket palette panel-left-close panel-left-open paperclip paperclip-2 password-check path-tool path-tool-2 path-tool-square pause pause-circle paypal pen-add pen-close pen-remove pen-tool pen-tool-2 pencil people percentage-circle percentage-square personalcard pet pharagraphspacing phone photoshop picture-frame play play-add play-circle play-cricle play-remove plug plus plus-circle pointer polkadot polygon polyswarm presentation-chart presention-chart previous printer printer-slash profile profile-2-user profile-add profile-circle profile-delete profile-remove profile-tick programming-arrow programming-arrows python quant quote-down quote-down-circle quote-down-square quote-up quote-up-circle quote-up-square radar radar-2 radio ram ram-2 rank ranking receipt receipt-1 receipt-2 receipt-21 receipt-add receipt-discount receipt-disscount receipt-edit receipt-item receipt-minus receipt-search receipt-square receipt-text receive receive-square receive-square-2 record record-circle recovery-convert reddit refresh refresh-2 refresh-circle refresh-cw refresh-left-square refresh-right-square refresh-square repeat repeat-circle repeate-music repeate-one reserve robot rotate-ccw rotate-cw rotate-left rotate-right route-square routing routing-2 row-horizontal row-vertical ruler ruler-pen safe-home sagittarius save-2 save-add save-minus save-remove scan scan-barcode scanner scanning scissor screenmirroring scroll search search-favorite search-favorite-1 search-normal search-normal-1 search-status search-status-1 search-zoom-in search-zoom-in-1 search-zoom-out search-zoom-out-1 security security-card security-safe security-time security-user send send-2 server setting setting-2 setting-3 setting-4 setting-5 settings shapes shapes-1 share share-2 shield shield-check shield-cross shield-lock shield-plus shield-search shield-security shield-slash shield-tick ship shop shop-add shop-remove shopping-bag shopping-cart shuffle shutterstock siacoin sidebar-bottom sidebar-left sidebar-right sidebar-top signpost simcard simcard-1 simcard-2 size slack slash slider slider-horizontal slider-horizontal-1 slider-vertical slider-vertical-1 smallcaps smart-car smart-home smileys sms sms-edit sms-notification sms-search sms-star sms-tracking snapchat snowflake solana sort sound sparkles speaker speedometer spotify stacks star star-1 star-slash stars status status-up stellar sticker stickynote stop stop-circle story strongbox strongbox-2 subtitle sun sun-1 sun-fog table-document table-lamp tag tag-2 tag-cross tag-right tag-user task task-square teacher telephone tenx tether text text-block text-bold text-italic text-underline textalign-center textalign-justifycenter textalign-justifyleft textalign-justifyright textalign-left textalign-right the-graph theta thorchain thumbs-down thumbs-up tick-circle tick-square ticket ticket-2 ticket-discount ticket-expired ticket-star timer timer-1 timer-pause timer-start toggle-off toggle-off-circle toggle-on toggle-on-circle trade transaction-minus translate transmit transmit-sqaure-2 transmit-square trash trash-2 tree trello trend-down trend-up trending-up triangle triangle-logo trontron truck truck-fast truck-remove truck-tick truck-time trush-square twitch two-page ui-8 unlimited unlock upload usd-coin user user-add user-check user-cirlce-add user-edit user-minus user-octagon user-plus user-remove user-search user-square user-tag user-tick users velas verify vibe video video-add video-circle video-horizontal video-octagon video-play video-remove video-slash video-square video-tick video-time video-vertical voice-circle voice-cricle voice-square volume volume-cross volume-high volume-low volume-low-1 volume-mute volume-slash volume-up wallet wallet-1 wallet-2 wallet-3 wallet-add wallet-add-1 wallet-check wallet-minus wallet-money wallet-remove wallet-search wallet2 wanchain wanchain-1 wand-sparkles warning-2 watch watch-status weight weight-meter whatsapp wifi wifi-square wind wind-2 windows wing woman wrist-clock x x-circle xd xiaomi xrp youtube zap zel zoom zoom-in zoom-out
linear outline bold bulk broken twotone
(auto) top bottom start end
React, generated from the controls
<AppAvatar name="Jane Doe" onClick={fn} />
Razor, the same props
<app-avatar name="Jane Doe" />

19 props. The 5 most used come first.

Used on most screens 5 props

PropTypeDefaultDescription
namedefault - string - The person's name. Used for the initials fallback and the image alt text.
srcdefault - string - The profile photo URL, usually a data or object URL. When set, the photo shows over the initials.
sizedefault md xs | sm | md | lg | xl | 2xl md A preset from xs to 2xl.
shapedefault circle Circle | Rounded | Square circle The disc shape.
tonedefault primary Primary | Neutral | Success | Warning | Danger | Info | Auto primary The colour of the initials face. auto gives each name a stable colour.

Less common 14 props

PropTypeDefaultDescription
size-pxdefault - number - The size in pixels, instead of a preset.
statusdefault none None | Online | Offline | Away | Busy none A presence dot at the lower right.
ringdefault false bool false A ring around the avatar.
labeldefault - string - Text shown as a tooltip above the avatar on hover or focus. It is also the accessible name of a link or button avatar.
icondefault - string - The face shown instead of initials when there is no photo: a library icon name or any node.
icon-variantdefault linear Linear | Outline | Bold | Bulk | Broken | Twotone linear The icon style of a named icon. A node icon is drawn as given.
badgedefault - string - A small count or marker in the top-right corner.
hrefdefault - string - Makes the avatar a link.
onClickdefault - - - Razor has no server-side click handler; use href to make the avatar a link instead.
linkComponentdefault - - - Not a tag-helper attribute. Razor's href always renders a plain anchor.
tooltipdefault - string - A tooltip on hover or focus that flips to stay on screen. Distinct from label, which is a fixed bubble.
tooltip-placementdefault auto Auto | Top | Bottom | Start | End auto The preferred tooltip side. auto picks the side with the most room.
photo-labeldefault Profile photo string Profile photo Replaces the built-in English text, for other languages.
classdefault - string - Extra classes on the avatar, merged with the component classes.

Screen reader

3 notes
  • A plain initials avatar is announced as an image named by label, else name; with a photo, the photo's alt text is the name, or 'Profile photo' when there is no name.
  • With href or onClick the whole avatar is one link or button named by label, else name, and the photo's alt text is empty.
  • With no name or label the avatar is hidden from assistive technology; the initials face, presence dot, badge and label bubble are always hidden from it.

Do and avoid

3 pairs

Always pass a name

Do

A name is always supplied, so the avatar shows meaningful initials and correct alt text.

Avoid

With no name and no photo the avatar can only render a bare question mark, which is useless to the eye and to a screen reader.

Beside the name it shows

Do
Ravi KumarRavi Kumar

The avatar sits next to the name it represents, so identity reads as one unit.

Avoid

On its own the avatar names no one, so the reader cannot tell whose row it is.

Use AppAvatar, not a plain image

Do

AppAvatar keeps the shared shape and falls back to initials when the photo is missing.

Avoid
Ravi

A hand-rolled round <img> drifts from the shared avatar shape and skips the initials fallback.