Avatar

Colour without an outline

A solid colour, one initial, and no outline. Names sit beside each avatar.

People and workspaces

Fill an avatar with a colour, or letter it in an ink on the neutral fill. A square one takes a picture’s corners.

ds-avatar draws a person or a workspace: a picture, an initial or an icon in a circle, or a square with shape="square". It is one control high (16px times --sf), so it sits inside a one-square row with type in the small size. size="large" is two squares. The product picks who a mark stands for, and handles selecting and acting on it.

<ds-avatar initial="J" label="Joachim"></ds-avatar>
<ds-avatar initial="高橋" label="高橋 由紀"></ds-avatar>
<ds-avatar src="/people/ana.jpg" initial="A" label="Ana"></ds-avatar>
<ds-avatar icon="globe" outlined label="Public"></ds-avatar>
Credits and roles

Small round identities align with names and quieter roles.

From a byline to a profile

The same identity at control height and two squares, paired with type.

An avatar is round. shape="square" gives it a picture’s corners: the shared 4px corner, scaled, or --ds-avatar-radius. It follows the surface’s data-ds-shape preference as other corners do. The product decides which marks are square, for example a workspace beside round people.

<ds-avatar shape="square" initial="S" label="Studio"></ds-avatar>
<ds-avatar shape="square" size="large" src="/workspaces/studio.png" initial="S" label="Studio"></ds-avatar>

React takes the same shape on Avatar.

A filled avatar has no outline by default. Use color with a single initial for the solid circles above; add outlined only when a border is wanted.

There are two ways to colour an avatar:

  • Fill. color fills the circle with a saved identity colour, and the initial takes black or white, whichever reads on it. Add outlined for the ink line around it.
  • Ink. ink letters the initial in a person’s colour on the neutral fill, and with outlined draws the line in the same colour. Give it a light-dark() pair, a darker shade that reads on white and a lighter one that reads on black.
<ds-avatar initial="A" color="#99ff73" outlined></ds-avatar>
<ds-avatar initial="J" ink="light-dark(#4b44e6, #b3aeff)" outlined></ds-avatar>

--ds-avatar-background sets the neutral fill behind an inked avatar on tinted paper. pending greys out someone who has not accepted yet, whichever way they are coloured.

A picture covers the circle; while it loads, or if it fails, the initial or icon stays. The person drawing (icon="avatar") comes with the avatar itself, so it draws in the first frame; other icons come from the icon library as usual. mask with fit="contain" draws a monochrome mark in the text colour.

A logo is not an avatar. The React Logo sets logo: a brand mark fitted into its image area (size="fill"), unclipped and without the avatar’s corners. Without a picture it shows its initial.

ds-avatar-group overlaps avatars by 3px. Copy avatar and avatar-group through Sync 1; React products import Avatar, Logo and AvatarGroup from DS1/react/avatar and DS1/react/avatar-group.