Skip to content

Search

Start typing to search.


Show all pages

Documentation

data

Avatar

A small picture or the initials of a person or organization.

CSS onlyPlain classes; no JavaScript in any stack.

Usage

Initials in a <span> with role="img" and the full name as its aria-label.

SV
HTML

Examples

Sizes

Pick the size that fits the text next to it.

SV NB LJ
HTML

With an image

Put an <img> with ca-avatar__image inside; it fills the avatar.

Calaca UI
HTML

Guidance and accessibility

When to use

  • Use an avatar to help people recognize a person or organization in a list, a comment or a header.
  • Show the name next to it when there is room; a face or initials alone are hard to tell apart.

Accessibility

  • Give initials role="img" and the full name as aria-label; give an image alt with the name.
  • When the name is already written next to the avatar, the avatar is decoration: use alt="" or aria-hidden="true".

Classes

Generated from the component contract. Parts use __, modifiers use --.

Classes of the avatar component
ClassKindUse it for
ca-avatarComponentThe frame that clips a picture or centers initials.
ca-avatar__imagePartAn <img> that fills the avatar.
ca-avatar--smSizeSmall, for lists and tables.
ca-avatar--mdSizeDefault size.
ca-avatar--lgSizeLarge, for profile headers.

Skins

The same markup, dressed by each skin. Structure and behavior stay the same; only the look changes.

Base skin

Neutral grayscale starting point; product skins extend it and change what differs.

SV

Calaca skin

The Calaca UI brand: hueso paper and tinta ink, cempasúchil marigold, rosa and jade.

SV

Proof skin

Pilot skin pushed far from base: square, heavy, offset shadows, larger targets.

SV

Crossview skin

The CrossView proofing table: cool ground, bond-paper sheets, rule-grey hairlines, one red mark.

SV

Framework notes

Link the prebuilt stylesheet of your skin next to your brand theme. No build step.

HTML
<link rel="stylesheet" href="theme.css" />
<link rel="stylesheet" href="ca-base.css" />