Ballmac UI home

Scene PartsPRO

New

The pieces every animated hero shares: an announcement pill, a pause and play button that reports its state, and a 2D canvas that sizes itself, pauses off screen, follows the theme and holds still under reduced motion.

v1.0.0Updated Oct 26, 2026
What changed

Installation

  1. Once per project: add the Pro registry and your licence key.

    components.json
    {
      "registries": {
        "@ballmac": "https://ui.ballmac.com/r/{name}.json",
        "@ballmac-pro": {
          "url": "https://ui.ballmac.com/r/pro/{name}.json",
          "headers": { "Authorization": "Bearer ${BALLMAC_LICENSE_KEY}" }
        }
      }
    }
    .env.local
    BALLMAC_LICENSE_KEY=your-licence-key
  2. Add it.

    $ pnpm dlx shadcn@latest add @ballmac-pro/scene-parts
  3. Need a licence or help with setup?

    The source is part of Ballmac UI Pro.

    Log in with your licence key to read and copy it here, or install it through the shadcn CLI or the MCP server. You own the code once it is in your project.

Usage

import { ScenePill, ScenePause, Canvas2D } from "@/components/ballmac/scene-parts"

The full example is in the Code tab above.

API reference

<ScenePill>

PropTypeDefault
label*

The announcement text.

string—
chip

The small solid chip before it.

string"New"

<ScenePause>

PropTypeDefault
paused*

Whether the animation is stopped.

boolean—
onPausedChange*

Called with the new state when the button is pressed.

(paused: boolean) => void—
pauseLabel

Label while the animation runs.

string"Pause the animation"
playLabel

Label while it is stopped.

string"Play the animation"

<Canvas2D>

PropTypeDefault
draw*

Draws one frame. Called every frame while the scene runs, and once (at `stillTime`) under reduced motion.

(ctx: CanvasRenderingContext2D, frame: Canvas2DFrame) => void—
paused

Stops the scene, for example behind a pause button.

booleanfalse
maxDpr

Highest device pixel ratio to draw at.

number2
stillTime

The moment, in seconds, drawn once when the visitor prefers reduced motion.

number6
version

Changing this redraws a still scene (reduced motion or paused), for scenes whose content changes by hand.

number0
label

Describes the picture for assistive technology. Leave empty when the scene is only decoration.

string—

Also accepts the standard attributes of its root element.

Accessibility

KeyAction
Enter, SpaceToggles the pause button; its aria-pressed reports the state

Use with AI

ScenePill is the announcement chip above a headline, ScenePause is the pause/play button (aria-pressed) every moving scene needs, and Canvas2D runs a draw(ctx, frame) function with pointer, DPR, theme and reduced-motion handled. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI Scene Parts (@ballmac-pro/scene-parts) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • Building your own animated hero or section on a canvas
  • Adding the pause control that long-running motion requires

Not for

  • Shader scenes (use webgl-canvas)
  • A one-off static drawing (an SVG is lighter)

Registry JSON (needs your licence key): https://ui.ballmac.com/r/pro/scene-parts.json

Credits

Covered by the Ballmac UI Pro license.