skip to content

Standard UI Components

The component families almost every system ships first, each specified by anatomy, variants, states, behaviour and accessibility. Interviewers probe whether you know each family's rules.

part ofDesign systems & UX foundationsoverview, primer and where to startread it →
on this pageshow

explore

questions

page 1 of 2

In a design system's avatar component, what should the avatar show when a person's photo is missing or fails to load?

level: juniorimportance: must knowfreq 55%

answer

  1. never a broken image
  2. a chain, not one fallback
  3. photo, then initials, then placeholder
  4. same person, same color everywhere
  5. entity type shapes the placeholder

basics

~20 s

An avatar falls through a fixed chain: the photo once it loads, otherwise the person's initials on a stable background color, otherwise a generic placeholder glyph. The frame and size never change, so nothing breaks or shifts.

solid answer

~40 s

I specify the avatar as a **fallback chain**, not a single image. First the photo; while it is missing, loading or has failed, the avatar shows **initials** from the name (usually first and last, one character for a single name) on a background color picked deterministically from the account's stable ID, so a person looks the same everywhere. If there is no usable name either, it shows a **placeholder** glyph, with a different shape or glyph for an organization than for a person. Every step renders in the same frame, so a failure never surfaces as a broken-image icon or a layout jump. Holding the initials to text contrast is the safe default, and the text alternative is the person's name at every step, or nothing when the name is already printed beside it.

go deeper

for a junior

Recall the three steps in order — photo, initials, placeholder — and that the frame never changes size. Be ready to say what triggers each step.

for a middle

Explain why initials show during loading as well as after errors, why the color comes from a hash of a stable ID, and the initials edge cases: single names, symbols, other scripts.

for a senior

Show the production judgment: legible initials across every palette color, one text alternative across all steps, decorative treatment beside printed names, and entity-aware placeholders tested with real international names.

for a principal

Frame the avatar as shared identity infrastructure: one chain and one color rule for every product surface, so identity looks consistent across teams, and changes to it are rolled out as a system decision.

## What the avatar has to guarantee An **avatar** is a small, fixed-size representation of a person or an entity (a client company, an agency, a team) shown beside comments, in message threads, on proposal cards and in headers. On a freelance job marketplace it appears dozens of times per screen, for people who never uploaded a photo, whose image link has expired, or whose photo is still downloading on a slow mobile connection. The design problem is therefore not "show a picture" but "always show something recognisable, in the same box, whatever the image does". Three guarantees follow from that: - **Never a broken state.** A failed image must never surface as the platform's broken-image glyph, an empty box or a collapsed element. - **Never a layout shift.** The frame is sized by the avatar's size tier, not by the image, so moving from one step of the chain to the next moves nothing around it. - **Always the same identity.** The same person looks the same on every screen and on every visit. ## The fallback chain A robust spec defines an ordered chain and the trigger that moves down it: 1. **Photo** — shown once it has actually loaded, cropped to the frame the same way everywhere. 2. **Initials** — shown while the photo is absent, still loading, or has failed, as long as a usable name exists. 3. **Placeholder** — a generic glyph when there is neither a photo nor a name that yields initials. | Step | Shown when | Stays the same | |---|---|---| | Photo | the image loaded successfully | frame size, shape, border | | Initials | no photo, still loading, or load error | frame, the person's color | | Placeholder | no photo and no usable name | frame, a neutral color | Showing the initials *while* the photo loads, then swapping the photo in, is common practice. It gives a slow connection something meaningful at once, and it makes the error path identical to the loading path, so there is one fewer state to design and test. ## Deriving initials Initials look trivial and carry most of the edge cases: - **Two characters is the usual maximum** — first given name and last family name. More crowds the frame at small sizes. - **Single names** (mononyms, many company names) give one character. - **Scripts without letter case, or without a given/family split**, can make two-letter initials meaningless. Many systems use the first character, or go straight to the placeholder where initials are not a cultural convention. - **Emoji, punctuation and leading symbols** in display names are stripped before characters are picked. - **Uppercase**, by convention, where the script has case. ## Color for initials The initials step needs a background color, and two rules make it work: - **Deterministic.** Pick from a fixed set of colors by hashing a stable identifier — the account ID, not the display name, which the person can edit. The same person then keeps the same color across screens, devices and sessions. - **Legible.** The initials are text. WCAG 2.2 success criterion 1.4.3 Contrast (Minimum) asks for 4.5:1 for normal text and 3:1 for large-scale text (at least 18 point, or 14 point bold). Text that is pure decoration is exempt, but an avatar is not always decorative, so checking every background in the set against the initials color at 4.5:1 is the safe default. The color is identity reinforcement only. It must never *encode meaning*, such as client versus freelancer: the colors are assigned by hash, not by category, and meaning carried by color alone fails WCAG 1.4.1 Use of Color. If the distinction matters, use shape or a text label. ## Placeholder and entity type The placeholder is the last resort, and it should still say *what kind of thing* this is. A common convention is a circle for people and a rounded square for organizations, each with its own glyph, so a client company and a freelancer stay distinguishable even with no image and no name. The placeholder uses a neutral color outside the identity set, so it is not mistaken for a real person's initials. ## Text alternative across the chain Whichever step renders, the avatar means the same thing, so its text alternative does not change with the step: it is the person's or the entity's name — never a description of the photo. When the name is already printed next to the avatar, as in a comment header, the avatar adds nothing and is treated as decorative so the name is not heard twice. WCAG 1.1.1 Non-text Content (Level A) covers both cases: a text alternative that serves the equivalent purpose, or, for decoration, a way for assistive technology to ignore it. How that name is attached to the element is a naming-mechanism question the accessibility rules own.

  • How should an avatar's initials handle a name written in a script where initials are not a convention?
    Do not force a two-letter rule onto every script. Common practice is to take the first character only, or to skip the initials step and show the placeholder. The spec should say which scripts get which treatment and test with real names, because a two-character rule built for Latin names can produce meaningless or even awkward pairs elsewhere.
  • Why should an avatar's initials background never encode account type, such as client versus freelancer?
    The colors are assigned by hashing an ID to spread identities apart, so any category meaning would be coincidental. If the product needs to show account type, a meaning carried by color alone also fails WCAG 1.4.1 Use of Color. Use a distinct placeholder shape, a glyph or a text label for the category, and leave color as identity reinforcement.
  • What changes in the avatar spec when the avatar sits right next to the person's printed name?
    The avatar becomes redundant for anyone using assistive technology, so it is treated as decorative and ignored, and the name is heard once. When the avatar stands alone, for example in a compact participant row, it carries the name as its text alternative. The fallback step shown does not change either decision.

A conference name badge: the photo badge is best, a printed name in large letters works when there is no photo, and a blank 'Guest' badge is the last resort — but every badge is the same size and clips to the same place.

saying these in an interview costs you the question

  • Showing the platform's broken-image icon when a photo fails is acceptable
  • The avatar frame can resize to fit the loaded photo's dimensions
  • Initials background color can be random on each render because it is decoration
  • Initials avatars can use any background color because contrast rules only cover body text
  • The avatar's text alternative should describe the photo, like 'smiling person in glasses'
  • A failed photo should jump straight to the generic placeholder even when a name exists
open as a page

In a design system, what distinguishes a modal dialog from a non-modal dialog, and when is each the right choice?

level: juniorimportance: must knowfreq 60%

basics

~20 s

A modal dialog makes everything behind it unreachable for every user until it closes, so it fits a decision needed before continuing. A non-modal dialog lets the user keep working on the page, so it fits reference or parallel tasks.

open as a page

In a design system's feedback components, when should a message be a toast, a banner or an inline alert?

level: juniorimportance: must knowfreq 60%

basics

~20 s

A toast briefly confirms a low-stakes result of the user's own action; a banner states a condition affecting the whole screen or account and stays until resolved; an inline alert sits next to the content it concerns.

open as a page

In a design system's loading guidance, when should a screen use a spinner, a skeleton screen, or a progress bar?

level: juniorimportance: must knowfreq 60%

basics

~20 s

Choose by wait length and what is known: a skeleton when the arriving content's layout is known, a spinner for a short wait of unknown shape, and a progress bar when measurable work takes longer.

open as a page

In a design system, what decides whether a hotel booking site's choice uses a checkbox, a radio group or a switch?

level: juniorimportance: must knowfreq 62%

basics

~20 s

A checkbox is an independent yes/no, or one of many picks, applied on submit; a radio group picks exactly one of a few visible options; a switch turns a setting on or off and takes effect immediately.

open as a page

In a design system, when should a screen use tabs, a segmented control, or navigation links to switch between views?

level: juniorimportance: must knowfreq 52%

basics

~20 s

Tabs switch between peer panels of different content within one page; a segmented control switches a mode or view of the same content; navigation links go to separate destinations with their own address and history.

open as a page

In a design system's text field spec, what do the label, helper text and error message each do, and why can't placeholder text replace them?

level: juniorimportance: must knowfreq 64%

basics

~20 s

The label names the value and stays visible; helper text gives purpose or format; the error message says what is wrong and how to fix it. Placeholder text vanishes on typing, is often too faint, and makes a poor name.

open as a page

In a design system, how does a tooltip differ from a popover, and what content is each allowed to hold?

level: juniorimportance: must knowfreq 58%

basics

~20 s

A tooltip is short supplementary text shown on hover or focus that never takes focus, so it holds no links, buttons or essential information. A popover opens on explicit activation, can take focus and may hold interactive content.

open as a page

On a notification badge in a freelance job marketplace, why cap the unread count at 99+, and what must the design still preserve?

level: middleimportance: must knowfreq 50%

basics

~20 s

Capping at 99+ keeps the badge's width bounded over its icon, and beyond two digits the exact number rarely changes what a user does next. The design must still expose the exact count on the destination screen and in the text alternative.

open as a page

In a design system, why is a disabled submit button that hides the reason a problem, and what should an e-signature app's 'Finish signing' do instead?

level: middleimportance: must knowfreq 55%

basics

~20 s

A silently disabled button gives no feedback: users cannot tell what is missing, and it may be faint and skipped by focus. Prefer an enabled button that, when pressed, names what is missing and leads there, or a visible reason.

open as a page

For a card whose whole surface opens a details page but which also holds a Save button, how should the click target and nested action work?

level: middleimportance: must knowfreq 55%

basics

~20 s

Make the title the card's one real link and extend its clickable area over the card, with the Save button layered above as a separate control. Never wrap the whole card, including the button, in one link or button.

open as a page

For a modal dialog, which dismissal routes should a design-system spec require, and when should a backdrop click not close it?

level: middleimportance: must knowfreq 55%

basics

~20 s

A modal dialog should close with Escape and with a visible close or cancel control, and every dismissal means cancel. Backdrop-click closing is optional and should be off when the dialog holds unsaved input or demands an explicit decision.

open as a page

For a toast in a design system, how long should it stay visible, and what should pause or extend that timing?

level: middleimportance: must knowfreq 52%

basics

~20 s

Long enough to read comfortably, scaled to its length; the timer pauses while the toast is hovered or focused, and a toast with an action stays longer or until dismissed. Users should be able to keep toasts on screen.

open as a page

When a form submission fails with several errors, what should an error summary contain, and how must it connect to the inline errors?

level: middleimportance: must knowfreq 64%

basics

~10 s

An error summary lists every error at the top of the form, takes focus after a failed submit, and links each entry to its field, where a matching inline message sits beside the input.

open as a page

In a design system, when should a payroll form's pay-frequency field stay a native select, and when is a custom listbox worth building?

level: middleimportance: must knowfreq 58%

basics

~20 s

Keep a native select for a short, plain-text, single choice: it brings the platform's picker, keyboard, screen-reader and zoom support for free. Build a custom listbox only when options need rich content, filtering or real multi-select, and budget its whole accessibility contract.

open as a page

A patient portal's date-of-birth text field signals an error only by turning its border red; what should the design-system spec require instead?

level: middleimportance: must knowfreq 56%

basics

~20 s

An error message in text, right beside the field, saying what is wrong and how to fix it, with an icon or other non-colour cue, tied to the field so it is read on focus, and the typed value kept.

open as a page

Under WCAG 2.2 success criterion 1.4.13 Content on Hover or Focus, what must a custom tooltip do to conform?

level: middleimportance: must knowfreq 55%

basics

~20 s

It must be dismissible without moving pointer or focus, hoverable so the pointer can move onto it without it vanishing, and persistent until the trigger is left, it is dismissed, or its information is no longer valid.

open as a page

In a design system, how should a button emphasis hierarchy work, and where do destructive actions fit into it?

level: juniorimportance: should knowfreq 50%

basics

~20 s

Emphasis ranks actions so the eye finds the main one: usually one primary per view or region, secondary for alternatives, low emphasis for minor ones. Destructive is an intent on any rung, signalled by label and placement, not colour alone.

open as a page

In a design system, what makes up a card's anatomy, and when should a collection use cards rather than list rows?

level: juniorimportance: should knowfreq 46%

basics

~20 s

A card is a container holding optional media, a required title, supporting metadata, optional body text and optional actions, with one primary target. Use cards to browse varied, visual items; use list rows to scan and compare many similar items.

open as a page

In a design system's form pattern, should forms mark the required fields or the optional ones, and what decides the choice?

level: juniorimportance: should knowfreq 46%

basics

~20 s

Mark whichever kind is the exception so the marker carries information, and use one convention across the whole system. Many systems write '(optional)' in the label when most fields are required, and no marker relies on colour alone.

open as a page

In form design, why is a single-column layout the usual default, and when may two fields share one row?

level: juniorimportance: should knowfreq 50%

basics

~20 s

A single column gives every user one unambiguous path, so fields are not skipped and reading order matches visual order. Two fields may share a row only when they form one short answer, such as card expiry month and year.

open as a page

On a hotel booking site's mobile filters, why should tapping a checkbox's label toggle it, and how should links inside that label be handled?

level: juniorimportance: should knowfreq 44%

basics

~20 s

Making the label part of the target turns a tiny box into a whole row, which is faster and easier to hit, especially on touch screens. A link inside that label competes for the same tap, so move it beside or below the label.

open as a page

In a payroll product, why is 'Export payslips' with its format choices an action menu, not a select, and what breaks if swapped?

level: juniorimportance: should knowfreq 46%

basics

~20 s

A select holds a value that a form keeps and submits; an action menu runs a command and holds no value. Commands in a select can fire while arrowing and look like saved settings; a menu cannot show or require a value.

open as a page

In a design system's avatar group, how should a stack of project members' avatars behave when there are more people than fit?

level: middleimportance: should knowfreq 32%

basics

~20 s

An avatar group shows up to a set maximum, then replaces the last slot with a same-size overflow indicator reading +N, where N is the number hidden. Activating it, or a nearby list, reveals everyone; all avatars share one size tier.

open as a page

In a design system, what should a button's loading state do while an e-signature is being submitted, and what goes wrong without one?

level: middleimportance: should knowfreq 40%

basics

~10 s

A loading state blocks repeat activation, keeps the button's size and position, keeps focus on it, and makes the busy state perceivable. Without it, signers press again, causing duplicate submissions, or assume nothing happened.

open as a page

In a design system, what is the anatomy of a list item, and what should a list's density setting change — and never change?

level: middleimportance: should knowfreq 38%

basics

~20 s

A list item has a leading slot, primary text, optional secondary text and a trailing slot for metadata, status or an action. Density changes spacing and row height — never the user's text size, targets below the minimum, contrast or the content itself.

open as a page

For a modal dialog, how should a design-system spec choose the initially focused element, and when may closing focus something other than the trigger?

level: middleimportance: should knowfreq 48%

basics

~20 s

Initial focus depends on content: usually the first focusable element, a static title for long or structured content, the least destructive action for irreversible steps. On close, focus returns to the trigger unless it is gone or the workflow continues elsewhere.

open as a page

In a design system's feedback components, how should severity levels map to visual treatment and to polite or assertive announcements?

level: middleimportance: should knowfreq 45%

basics

~10 s

Each severity gets a text label or icon plus colour, never colour alone. Success and information are announced politely; only messages that need immediate attention are assertive, and no feedback message moves focus.

open as a page

showing 1–30 of 53