Team join
NewAn invite is accepted: a wash of colour blooms over the app, the empty seat in the avatar stack fills, and a card introduces the newcomer.
The live component, numbered part by part. Every measurement is read from it as it is drawn. Point at a row to outline its part, or at a part to find its row.
The choices it offers, each value drawn live and the default marked, with how to pick one.
When to use
- Telling a team that someone new has just joined, in the place where the team already shows: the avatar stack in the top bar.
- A moment worth marking once: an invite accepted, a first teammate, a seat filled on a shared workspace.
- Offering the one or two things people do next with a newcomer, such as
FollowandSay hi, without leaving the page.
When not to use
- Routine activity (someone opened a file, changed a setting). Use a quiet toast or the activity feed; the wash is for rare events.
- Several people joining at once. Show one summary (“3 people joined”) in a toast or the members page, not a wash per person.
- Anything the reader must act on or confirm. The card leaves by itself; use a dialog or an inbox item.
- A screen with no avatar stack to land in: the card points at the seat it fills.
The sequence
- 0 s: the wash starts at the top right, a quarter of its size and clear.
- 0.58 s: the wash is near its height; the empty seat crossfades into the newcomer in 0.3 s, with a small spring.
- 1.3 s: the card comes in under the stack in 0.32 s, unblurring and growing 4% from its top right; the live region says who joined.
- 1.55 s: the wash has faded out. The card stays until its ×, Escape, or its count runs out.
Placement
- Under the stack it fills, right-aligned with the bar, so the eye goes from the new face to the card about it.
- Over the content, not in it: nothing moves while the card is up, and it leaves no gap behind.
- Once per join: a second invite accepted while the card is up replays the sequence for the new person.
Each one drawn with the component itself, used well or badly.
The words are the eyebrow, the person’s name, role and place, and the two actions.
- Joined your team as the eyebrow, in sentence case, without a full stop.
- The full name, then the role and the place joined by a middle dot.
- Verbs on the buttons:
Follow,Say hi; their done states say what happened:Following,Hi sent. - The announcement names the person and the event: “Noa Okafor joined your team”.
You can add this component with the shadcn CLI or by hand:
Into components/team-join of any React project, with no setup:
npx shadcn@latest add https://brunodelorence.com/r/team-join.json- Copy the component files
Copy these files into one folder of your project, keeping their relative imports together, or download them as a ZIP:
- Import it
As shown under Usage, below.
Either way it needs React 19.2 and a bundler that supports CSS Modules, such as Next.js or Vite. It has a dark colour scheme: it follows your page’s color-scheme, light unless the page sets one, or its colorScheme prop, with nothing to configure. Browsers without light-dark() show it light.
Usage
import { TeamJoin } from './team-join';export function TeamBar() { return ( <TeamJoin person={{ name: 'Noa Okafor', role: 'Product designer', place: 'Lisbon' }} onFollowChange={(following) => console.log('following', following)} onSayHi={() => console.log('open a chat')} autoplay={false} /> );}Each state below is a live instance, locked so you can study it.
The pieces it is built from, each with its measurements read live.
An app’s top bar shows the team as a stack of ringed avatars and one empty, dashed seat. When the invite is accepted, a soft wash of green, aqua and lavender blooms from the top right over the whole screen and fades; at its height the seat turns into the newcomer’s avatar in a blue ring, and a card slides in under the stack: Joined your team, their drawn portrait with an online dot, name, role and city, Follow and Say hi. The card leaves on its ×, on Escape, or by itself after a while unless the pointer or the focus is on it; the newcomer’s avatar brings it back.
- One clock from the invite being accepted, timed from the reference: the wash runs 1.55 s, the seat changes at 0.58 s, the card comes in at 1.3 s and leaves in 0.2 s.
- The wash is three layers faded in turn by the Web Animations API over the same 1.55 s: a haze (a light veil with a 5 px backdrop blur) up by 0.28 s; green to mint in an ellipse about the top right, at its height from 0.5 to 0.7 s and gone by 1.18 s while it grows 0.9 to 1.12; then aqua, blue and lavender from the middle down, at 0.95 opacity by 0.78 s, sliding 22% down as they fade. So the green leads from the top and the top clears first, as in the reference.
- The wash sits over the window but under the avatar stack, which is lifted to its own layer: the faces stay sharp on the colour, with the bar’s white showing in each avatar’s 2 px gap.
- The seat is the dashed circle and the newcomer’s avatar in one place: the circle fades and shrinks to 90% in 0.3 s while the avatar fades in and grows from 82% on a small overshoot, cubic-bezier(0.34, 1.5, 0.64, 1) over 0.5 s.
- The card enters in 0.32 s from opacity 0, an 8 px blur, 6 px up and 96% size, grown from near its top right corner, on cubic-bezier(0.2, 0.8, 0.2, 1); it leaves in 0.2 s to a 6 px blur at 97%.
- Sizes measured at about 4 video px per CSS px: a 54 px bar, 34 px avatars 26 px apart with a 2 px ring and a 2 px gap, a 320 px card with a 16 px radius and 18 px sides, a 46 px portrait with a 12 px dot, 38 px pills 8 px apart.
- The card counts down 8 s; the count stops while the pointer or the focus is on it and starts over when both leave. The portraits are drawn in SVG on a 40 × 40 grid from a few parameters (tint, skin, hair style, shirt).
- While on screen and untouched, a demo accepts the invite, moves the pointer to the × and closes the card, then empties the seat again, about every five seconds; any input from the reader stops it. Every colour is a token on the root with light-dark(); at night the wash is deeper and translucent.
| Prop | Type | Default | Description |
|---|---|---|---|
person | { name: string; role: string; place: string; face?: FaceId } | Noa Okafor, Product designer, Lisbon | Who joins: shown on the card and announced; face picks one of the drawn portraits. |
defaultPhase | 'pending' | 'joined' | 'card' | 'pending' | Where it starts: the empty seat, the newcomer already in the stack, or the card open too (a still for docs; it turns the demo off). |
autoDismiss | number | 8000 | ms before the card leaves by itself, counted again whenever the pointer and the focus leave it; 0 keeps it until closed. |
onJoin | () => void | — | Called when the newcomer is in the stack and the card shows. |
onFollowChange | (following: boolean) => void | — | Called with the new state when Follow is pressed. |
onSayHi | () => void | — | Called once, when Say hi is pressed; the button then reads Hi sent. |
defaultFollowing | boolean | false | Starts with Follow on. |
defaultWaved | boolean | false | Starts with the hello already sent. |
autoplay | boolean | true | While on screen and untouched, a demo plays the join and closes the card in a loop; any input from the reader stops it. |
colorScheme | 'light' | 'dark' | 'system' | — | Light or dark colours, or the reader’s; without it, the page’s color-scheme. |
className | string | — | A class for the stage. |
Focus and keyboard
- The card never takes the focus: it comes right after the avatar stack in the tab order, so Tab reaches the ×, Follow and Say hi from the seat.
- Escape inside the card closes it. Closing it while the focus is inside puts the focus on the newcomer’s avatar, never on the page.
- The seat is a button: empty, it accepts the invite; taken, it shows and hides the card, with
aria-expanded. - Every control shows a 2 px focus ring on keyboard focus.
Screen readers
- A polite live region says “Noa Okafor joined your team” when the card shows, and the outcome of Follow and Say hi.
- The card is a
sectionnamed by its eyebrow; the name is followed by a hidden “online”, since the dot is only colour. - Each avatar in the stack is an image named by the person; the stack is a group named by the team’s size. The wash, the skeletons and the demo pointer are hidden.
Timing
The card leaves by itself after 8 s by default (WCAG 2.2.1): the count stops while the pointer or the focus is on it, starts over when both leave, and autoDismiss={0} turns it off. Nothing on it is lost when it goes: the newcomer’s avatar brings it back.
Motion
With reduced motion there is no wash, no spring and no blur: the newcomer’s avatar fades in, and the card fades in over 0.2 s and out over 0.15 s. The demo does not play.
In this build
- A polite live region announces “Noa Okafor joined your team” when the card shows, and the outcome of Follow and Say hi.
- The card never takes the focus. It follows the avatar stack in the tab order; Escape inside it closes it, and closing it from inside hands the focus to the newcomer’s avatar.
- The seat is a button: empty, it accepts the invite; taken, it shows or hides the card, with aria-expanded and aria-controls.
- The card is a section named by its title, Joined your team; the green online dot is backed by a hidden “online” after the name.
- The auto dismiss pauses while the pointer or the focus is on the card and can be turned off with autoDismiss={0}; the newcomer’s avatar brings the card back.
- With reduced motion there is no wash, spring or blur: the avatar and the card only fade, and the demo does not play. Every control shows a focus ring on keyboard focus.
The complete source behind this demo. Open source under the MIT license, © 2026 Bruno Delorence: copy it, change it, ship it.
// Copyright (c) 2026 Bruno Delorence. MIT License.'use client';import { useEffect, useEffectEvent, useId, useRef, useState, type CSSProperties, type FocusEvent,} from 'react';import { DemoPointer, runDemo, type Point } from './demo-pointer';import { Face, type FaceId } from './faces';import { CheckGlyph, CloseGlyph, PersonGlyph, ReplayGlyph, WaveGlyph } from './glyphs';import { useAutoplay } from './use-autoplay';import styles from './team-join.module.css';/* * Team join: an app's top bar with the team as a stack of ringed avatars and one empty, dashed * seat. When the invite is accepted, a soft wash of colour (green, aqua, then lavender) blooms * from the top right over the whole screen and fades; while it is at its height the empty seat * turns into the newcomer's avatar, and a card slides in under the stack: “Joined your team”, who/* Team join (team-join.tsx): a light app window, its top bar with the team's avatar stack and an empty dashed seat, a dotted canvas and a panel of skeleton rows. On a join, a wash of colour blooms over it, the seat becomes the newcomer, and a card comes in under the stack. Sizes are px measured from the reference at about 4 video px per CSS px: a 54 px bar, 34 px avatars 26 px apart with a 2 px ring and a 2 px gap, a 320 px card with 18 px padding and a 16 px radius, a 46 px portrait with a 12 px online dot, 38 px pill buttons 8 px apart. Layers: the window (1), the wash (2), the avatar stack lifted over the wash (3) so the faces stay sharp on it, the card (4), the demo pointer (5). The bar must not make a stacking context of its own, or the stack could not rise above the wash. Colours are the tokens below, light-dark(light, dark) where the two differ. */.root { --stage: #f2f2f3; --window: #f5f5f6; --window-edge: rgb(0 0 0 / 0.06); --bar: #fff; --bar-edge: rgb(0 0 0 / 0.07); --dot: #d7d7da; --panel: #fff; --skeleton: #f1f1f2; --skeleton-strong: #ececee;// Copyright (c) 2026 Bruno Delorence. MIT License./* * The team's portraits, drawn here: no photos. Each is a head and shoulders on a soft tint, drawn * on a 40 × 40 grid and shown through a 30 × 30 window round the head, so the face fills the * avatar as a cropped portrait would; the avatar's own radius cuts it round. A face is a handful * of parameters, so a new person is one more line in FACES. */type Hair = 'curly' | 'short' | 'bun' | 'long' | 'cap';export type FaceId = 'ines' | 'kai' | 'priya' | 'noa' | 'theo';type Look = { tint: string; skin: string; /** A shade of the skin, for the neck and the ears' insides. */ shade: string; hair: string; style: Hair; shirt: string; glasses?: boolean; /** The cap's colour, for the cap style. */ cap?: string;// Copyright (c) 2026 Bruno Delorence. MIT License./* * The few icons the component draws, on a 16 × 16 grid in currentColor, so each takes the colour * of the control it sits in. All are decorative: the control carries the words. */type GlyphProps = { className?: string };const svg = { viewBox: '0 0 16 16', 'aria-hidden': true, focusable: false } as const;/** The close cross. */export function CloseGlyph({ className }: GlyphProps) { return ( <svg className={className} {...svg}> <path d="M4.5 4.5l7 7m0-7l-7 7" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round" fill="none" /> </svg> );// Copyright (c) 2026 Bruno Delorence. MIT License.'use client';import type { CSSProperties, Ref } from 'react';/* * The demo's pointer, and the steps that move it. A demo is a script of awaited steps: wait, or * glide the pointer somewhere. Stopping the demo (the reader takes over, or it scrolls away) ends * the step in progress at once: its promise rejects, which ends the script right there, and the * pointer fades out. * * Each glide is a curved flight played by the Web Animations API, so nothing runs frame by frame. * The points of the flight are handed to whoever wants to move along with it (nothing here uses * them yet). The arrow and the hand are HTML boxes * that swap by their visibility: a change of style inside an SVG would lay the SVG out again. */export type Point = { x: number; y: number };/** A glide's path and timing, for an animation that plays along with it. */export type Flight = { points: Point[]; timing: KeyframeAnimationOptions };export type Demo = {// Copyright (c) 2026 Bruno Delorence. MIT License.'use client';import { useCallback, useEffect, useRef, useState } from 'react';/* * When a demo may play on its own: while part of it is on screen and the tab is visible, never * under reduced motion, and never again once the reader has used it: `take()` hands it to the * reader for good (until the component mounts again), so it can't come back on its own. */export function useAutoplay<T extends HTMLElement>() { const ref = useRef<T>(null); const [visible, setVisible] = useState(false); const [reduced, setReduced] = useState(true); const [taken, setTaken] = useState(false); useEffect(() => { const element = ref.current; if (!element) return; let onScreen = false; const update = () => setVisible(onScreen && !document.hidden); const observer = new IntersectionObserver( ([entry]) => {