A wider screen, please

This page features interactive demos and side-by-side code samples that need at least 340 pixels of horizontal space. Please widen your browser window, or rotate your device, to continue.

Morpheus v0.1.0
v0.1.0

Avatar#

Component <neo-avatar> is a style-only frame for one avatar image or fallback. Shares shape tokens with Avatars so a theme renders standalone avatars and avatar groups round, square, or hexagonal together.

Default
Image
Fallback
Deactivate Rename Duplicate
Delete
New state Toggle autoplay
Roman Scharkov
HTML CSS

The selected state's markup and its scoped CSS. The CSS is wrapped in <style>@scope { ... }</style> and applies to the preview only. Edits change the preview above, applied live while Sync is on, or when you click Patch or Replace. Patch morphs the preview; Replace swaps it outright.

Replace Patch

Signals

Datastar signals declared in the selected state's markup. Change a value to drive the preview, applied live while Sync is on, or when you click Patch.

Patch

Reference#

Slots #

NameDescription
defaultAvatar content. Usually an <img>, but fallback initials or an icon work too.

CSS variables #

NameDefaultDescription
--neo-avatar-size2.25remAvatar width and height.
--neo-avatar-radius9999pxCorner radius.
--neo-avatar-clip-pathnoneClip path applied to the frame.
--neo-avatar-filternoneFilter applied to the frame.
--neo-avatar-bgcolor-mix(in srgb, var(--page-fg) 8%, transparent)Fallback background fill.
--neo-avatar-colorvar(--page-fg)Fallback text color.
--neo-avatar-border-width0Border width.
--neo-avatar-border-colorvar(--page-bg, #ffffff)Border color.
--neo-avatar-font-size0.8125remFallback initials font size.
--neo-avatar-font-weight650Fallback initials font weight.

Examples#

Image#

Set src plus an alt to cover the common portrait case. The image is cropped to the frame with object-fit: cover.

Daniel Scharkov

Fallback#

Omit src and give the default slot initials, an icon, or another compact placeholder. Add an aria-label when the fallback text is abbreviated.

DVSKCD

Settings

Theme

Default Sunshine Ocean Matrix Rose

Accessibility

Playgrounds

Server Simulator