Interaction Choreography

Physics Tag Pile

Tags drop and pile up like physical objects, and can be picked up and thrown — a 2D physics simulation.

This is a WebberUI Pro component

The install command below needs a licence to run; without one it returns 401.

How to install Pro components →See the plans →

Pill tags drop in sequence from the top of the container, colliding, jostling, and piling up at the bottom; you can grab and drag them with the mouse or touch, and fling them (with velocity momentum), and any tag they hit picks up momentum too. The physics engine is a hand-written lightweight 2D capsule collision simulation (gravity, restitution, friction, an rAF loop) with zero external physics libraries — great for skill walls, interest tags, and other playful showcases.

Bring this into your project

Run this command in your project folder. The CLI adds the source and dependencies; then follow the usage example below.

npx webberui@latest add "https://webberui.com/r/physics-tags.en.json?t=<install token>"

New project or installation trouble? Start here →

Playground

Tune the props live — the code snippet updates as you go, so you can dial in the look you want before copying it.

1400
0.3
300
Active edited usageDefault props
<PhysicsTags/>

The complete example includes the preview layout and data. Install the component first, then paste this file into your project.

Installation

npx webberui@latest add "https://webberui.com/r/physics-tags.en.json?t=<install token>"

Or, once registries are configured in components.json, install it as @webberui/physics-tags.

Usage

import { PhysicsTags } from "@/components/ui/physics-tags";

<PhysicsTags
  tags={[
    { label: "React", hue: 200 },
    { label: "TypeScript", hue: 215 },
    { label: "Motion design", hue: 330 },
  ]}
  gravity={1400}
  height={340}
/>

Props

PropTypeDefaultDescription
tagsPhysicsTagItem[]—The tag data array; changing it makes the tags drop again
tags[].labelstring—Display text of the tag
tags[].huenumberevenly spread around the hue wheel by indexHue 0–360, deciding this tag's colours
gravitynumber1400Gravitational acceleration (px/s²)
restitutionnumber0.3Collision restitution 0–1; higher is bouncier
heightnumber360Container height (px)
classNamestring—Forwarded to the outermost container

Accessibility

  • When the user has "reduce motion" enabled at the system level, no simulation starts at all and the tags are presented as a static flex arrangement at the bottom of the container
  • The physics-layer pills are hidden from assistive technology (aria-hidden), with a separate sr-only static list so screen readers can read out every tag in full
  • The container carries role="group" and a descriptive aria-label (including the total tag count)
  • Touch dragging is supported (touch-action: none is applied only to the tags themselves, so page scrolling is unaffected)
  • The rAF loop pauses automatically when the component scrolls out of the window, saving power and CPU