Skip to content

PresenceBadge

PresenceBadge

A person's availability as a small badge, usually placed on an Avatar (badge prop).

Every status has its own shape, so it is not conveyed by color alone: available (check), busy (solid), away (clock), offline (hollow ring with an X), do not disturb (bar), out of office (arrow, mirrored in right-to-left layouts). A background-colored ring separates it from the avatar. It is a named image (role="img", aria-label = the status name; pass aria-label to localise or extend it) and never a live region.

Examples

Available

export const Available: Story = {};

Busy

export const Busy: Story = {
  args: { status: 'busy' },
};

Away

export const Away: Story = {
  args: { status: 'away' },
};

Offline

export const Offline: Story = {
  args: { status: 'offline' },
};

DND

export const DND: Story = {
  args: { status: 'do-not-disturb' },
};

OOF

export const OOF: Story = {
  args: { status: 'out-of-office' },
};

All Statuses

export const AllStatuses: Story = {
  args: { size: 'extra-large' },
  render: (args) => (
    <div className="flex items-center gap-4">
      {STATUSES.map((status) => (
        <PresenceBadge key={status} {...args} status={status} />
      ))}
    </div>
  ),
};

Out Of Office

export const OutOfOffice: Story = {
  args: { size: 'extra-large', outOfOffice: true },
  render: (args) => (
    <div className="flex items-center gap-4">
      {STATUSES.map((status) => (
        <PresenceBadge key={status} {...args} status={status} />
      ))}
    </div>
  ),
};

Props

NameTypeRequiredDefaultDescription
status'available' | 'busy' | 'away' | 'offline' | 'do-not-disturb' | 'out-of-office' | 'blocked' | 'unknown'No'available'

Presence status to display. The names of 0.x that 1.0 removed from the type, 'dnd' and 'oof', still draw 'do-not-disturb' and 'out-of-office' when they come from code that no type checker reads (server data, JavaScript), with a development warning once per name: a bridge that may go in 2.0, so map such data to the new names. Any other value (a misspelled name, null) draws 'offline', with a development warning once. 'blocked' (a person you blocked) draws a bar across a red disc and 'unknown' (no presence data) a question mark on the page color, each with a shape of its own.

outOfOfficebooleanNofalse

Marks the person as out of office, whatever their status: the badge draws the out-of-office arrow in the status's own color on the page color, and its name gains ", out of office". With status="out-of-office" it changes nothing (that status already draws the arrow). Rendered as a boolean data-out-of-office. Fluent's outOfOffice.

size'extra-small' | 'small' | 'medium' | 'large' | 'extra-large'No'medium'

Size of the presence indicator. In the badge slot of an Avatar it is sized from the avatar.

refReact.Ref<HTMLSpanElement>No

Ref to the root <span>.

slotProps{ icon?: SlotPart<'svg'> }No

Props for the element the badge draws inside its root, by part, merged into the part's own: your classes after the part's (yours win a conflict), your styles over its styles, your attributes and handlers added, your ref attached. Every attribute the badge sets on the part is locked. A part takes no children (the badge draws its glyph); the root takes the badge's own props.

Any other prop is passed to the element it renders (HTMLSpanElement).

Parts

  • icon

Stable class names

PartClass
rootwave-presence-badge
iconwave-presence-badge__icon