Component

Floating Reactions

A transient emoji-burst overlay for meeting and live surfaces. Reactions float upward and fade — distinct from the static ReactionBar that shows persistent counts.

Static burst

A fixed set of reactions rendered at SSR time — useful for previews or server-rendered snapshots of a burst moment.

Meeting surface

Lanes

Reactions spread across horizontal lanes so simultaneous emojis don't stack. Lane 0 is far-left, lane N-1 is far-right.

5 lanes (0–4)

Interactive

Use useFloatingReactions() to emit reactions with automatic expiry after REACTION_LIFETIME_MS (3 s).

Reactions float here

Installation

$pnpm add @refraction-ui/react

Usage

tsx
import {
  FloatingReactions,
  useFloatingReactions,
} from '@refraction-ui/react'

export function MeetingOverlay() {
  const { reactions, emit } = useFloatingReactions()

  return (
    <div className="relative w-full h-64 bg-muted rounded-xl overflow-hidden">
      {/* Your video / content here */}
      <FloatingReactions reactions={reactions} lanes={5} />
      <button
        className="absolute bottom-4 right-4"
        onClick={() => emit('👋', { lane: 2 })}
      >
        Wave
      </button>
    </div>
  )
}

Props

PropTypeDefaultDescription
reactionsFloatingReaction[]--Controlled list of active reactions. Each item has `id`, `emoji`, and optional `lane` (horizontal offset bucket 0..lanes-1).
lanesnumber5Total number of horizontal lane buckets used to spread reactions across the overlay.
classNamestring--Additional CSS classes applied to the overlay container.