> ## Documentation Index
> Fetch the complete documentation index at: https://hyperframes.heygen.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Spring Pop

> A badge pops in from a visible near-rest scale, overshoots full size once, and settles cleanly.

export const InstallCommand = ({command}) => {
  const [copied, setCopied] = React.useState(false);
  const copy = async () => {
    try {
      if (navigator.clipboard && window.isSecureContext) {
        await navigator.clipboard.writeText(command);
      } else {
        const previous = document.activeElement;
        const scratch = document.createElement("textarea");
        scratch.value = command;
        scratch.setAttribute("readonly", "");
        scratch.style.position = "fixed";
        scratch.style.opacity = "0";
        document.body.appendChild(scratch);
        scratch.select();
        document.execCommand("copy");
        document.body.removeChild(scratch);
        previous?.focus?.();
      }
      setCopied(true);
      setTimeout(() => setCopied(false), 2000);
    } catch {}
  };
  return <div className="hf-install-command not-prose my-4 flex items-stretch overflow-hidden rounded-xl border border-zinc-200 bg-zinc-50 dark:border-zinc-800 dark:bg-zinc-900">
      <code className="flex-1 overflow-x-auto whitespace-nowrap border-r border-zinc-200 px-4 py-3 font-mono text-sm text-zinc-800 dark:border-zinc-800 dark:text-zinc-100">
        {command}
      </code>
      <button type="button" onClick={copy} data-copied={copied ? "true" : "false"} aria-label={`Copy ${command} to the clipboard`} className="hf-install-copy">
        <svg className="hf-install-copy-clipboard" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 18 18" fill="none" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
          <path d="M14.25 5.25H7.25C6.14543 5.25 5.25 6.14543 5.25 7.25V14.25C5.25 15.3546 6.14543 16.25 7.25 16.25H14.25C15.3546 16.25 16.25 15.3546 16.25 14.25V7.25C16.25 6.14543 15.3546 5.25 14.25 5.25Z" />
          <path d="M2.80103 11.998L1.77203 5.07397C1.61003 3.98097 2.36403 2.96397 3.45603 2.80197L10.38 1.77297C11.313 1.63397 12.19 2.16297 12.528 3.00097" />
        </svg>
        <svg className="hf-install-copy-check" xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 18 18" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true">
          <path d="M2.75 9.5L6.5 13.25L15.25 4.5" />
        </svg>
      </button>
      <span className="hf-install-copy-status" role="status" aria-live="polite">
        {copied ? "Copied" : ""}
      </span>
    </div>;
};

<iframe className="w-full aspect-video rounded-xl border-0 bg-zinc-100 dark:bg-zinc-800" title="spring-pop preview" loading="lazy" srcDoc={`<!doctype html><html><head><meta charset="utf-8"><style>html,body{margin:0;height:100%;overflow:hidden;background:transparent}hyperframes-player{display:block;width:100%;height:100%}</style><script src="https://cdn.jsdelivr.net/npm/@hyperframes/player@0.7/dist/hyperframes-player.global.js"><\/script></head><body><script>fetch("/public/catalog/components/spring-pop.json").then(function(r){return r.json()}).then(function(d){var p=document.createElement("hyperframes-player");p.setAttribute("srcdoc",d.html);p.setAttribute("controls","");p.setAttribute("autoplay","");p.setAttribute("loop","");p.setAttribute("muted","");p.setAttribute("poster","https://static.heygen.ai/hyperframes-oss/docs/images/catalog/components/spring-pop.png");document.body.appendChild(p)});<\/script></body></html>`} />

## Install

<InstallCommand command="npx hyperframes add spring-pop" />

That writes one file: `compositions/components/spring-pop.html`.

## Paste it into your composition

Open `compositions/components/spring-pop.html` and copy what is inside into your own composition.

A component has no size or duration of its own. It takes both from the composition
you paste it into.

## Variables

Every one of these has a default, so the piece works untouched. Set the ones you
want to change on the element:

| Variable    | Default | Accepts                | What it does                                    |
| ----------- | ------- | ---------------------- | ----------------------------------------------- |
| `overshoot` | `1.7`   | 1.1 to 2, step 0.1     | Strength passed to the back.out entrance curve. |
| `fromScale` | `0.9`   | 0.8 to 0.97, step 0.01 | Scale at the start of the entrance.             |
| `text`      | `New`   | string                 | Text displayed inside the badge.                |

Set them with `data-variable-values` on the element that mounts it. These are the
defaults, so this behaves exactly like the preview above until you change one:

```html wrap theme={null}
<div
  data-composition-id="spring-pop"
  data-composition-src="compositions/components/spring-pop.html"
  data-variable-values='{"overshoot":1.7,"fromScale":0.9,"text":"New"}'
></div>
```

## Source

<Accordion title={`spring-pop.html`}>
  ```html theme={null}
  <!doctype html>
  <!--
    spring-pop: HyperFrames video primitive (effects / burst / reveal)

    Concept: one badge arrives from scale 0.9 and opacity 0, passes slightly
    beyond full size, then settles exactly at scale 1. One mechanic, one job:
    revealing an element with a restrained, physical overshoot.

    Compiled-from evidence: Video Primitives v1 build contract, Easing
    vocabulary (--ease-overshoot = GSAP back.out(1.7), taste rules 4 and 5),
    plus hyperframes-animation rules/spring-pop-entrance.md's playful
    overshoot variation. This fills the gap left by spring-scale-in, whose
    power3.out curve never overshoots.

    Use when: a new badge, compact card, icon, or product detail deserves one
    lively entrance. Keep it to the single element that earns emphasis.

    Variables:
      - overshoot (number, 1.1 to 2.0, default 1.7): the strength passed to
        GSAP back.out(overshoot).
      - fromScale (number, 0.8 to 0.97, default 0.9): the visible start scale.
      - text (string, default "New"): the badge label.

    Envelope: fixed 0.60s IN carries the complete pop, followed by a
    deliberately still elastic HOLD. There is no OUT because this reveal
    establishes the element's resting state. If duration is shorter than
    0.60s, IN compresses to fit and HOLD becomes zero.

    Sync point: pop-settle occurs at 0.60s into IN, scaled only when the full
    duration is shorter than the fixed entrance. It never enters HOLD.

    Sound: none. A parent scene may place a static cue at pop-settle.

    Mount contract: the runtime clones only this template. #root fills the
    host box, establishes the container query basis, has no data-width or
    data-height, and registers one paused timeline under the hardcoded
    spring-pop id.
  -->
  <html
    lang="en"
    data-composition-variables='[
      { "id": "overshoot", "type": "number", "role": "timing", "label": "Overshoot", "description": "Strength passed to the back.out entrance curve.", "default": 1.7, "min": 1.1, "max": 2, "step": 0.1 },
      { "id": "fromScale", "type": "number", "role": "timing", "label": "Starting scale", "description": "Scale at the start of the entrance.", "default": 0.9, "min": 0.8, "max": 0.97, "step": 0.01 },
      { "id": "text", "type": "string", "role": "content", "label": "Label", "description": "Text displayed inside the badge.", "default": "New" }
    ]'
  >
    <head>
      <meta charset="UTF-8" />
      <title>Spring Pop</title>
    </head>
    <body>
      <template>
        <div id="root" data-composition-id="spring-pop" data-duration="2" data-fps="30">
          <style>
            *,
            *::before,
            *::after {
              box-sizing: border-box;
            }

            #root {
              position: absolute;
              inset: 0;
              container-type: size;
              isolation: isolate;
              overflow: hidden;
              color: var(--fg, #f8fafc);
              font-family: var(--font-body, Inter, system-ui, sans-serif);
              pointer-events: none;
            }

            .sp-clip {
              position: absolute;
              inset: 0;
              display: grid;
              place-items: center;
              overflow: hidden;
            }

            /* EDIT ZONE: badge proportions only. The centered 82cqw ceiling
               reserves clearance for the overshoot at every allowed value. */
            .sp-badge {
              display: flex;
              align-items: center;
              justify-content: center;
              gap: var(--space-2, 2.4cqw);
              min-width: 48cqw;
              max-width: 82cqw;
              min-height: 32cqh;
              padding: var(--space-2, 2.4cqh) var(--space-3, 4cqw);
              border: 0.18cqmin solid var(--border, #334155);
              border-radius: var(--radius, 3cqmin);
              background: var(--surface, #1e293b);
              box-shadow: 0 2.4cqh 7cqh color-mix(in srgb, var(--bg, #0b1120) 42%, transparent);
              transform-origin: 50% 50%;
              will-change: transform, opacity;
            }

            .sp-dot {
              flex: 0 0 auto;
              width: 3.2cqmin;
              aspect-ratio: 1;
              border-radius: 50%;
              background: var(--brand, #22c55e);
              box-shadow: 0 0 2.4cqmin color-mix(in srgb, var(--brand, #22c55e) 58%, transparent);
            }

            .sp-label {
              min-width: 0;
              overflow: hidden;
              color: var(--fg, #f8fafc);
              font-family: var(--font-display, Inter, system-ui, sans-serif);
              font-size: clamp(14px, 9cqmin, 54px);
              font-weight: 720;
              line-height: 1.2;
              letter-spacing: -0.02em;
              text-overflow: ellipsis;
              white-space: nowrap;
            }
          </style>

          <div
            id="spring-pop-clip"
            class="sp-clip clip"
            data-start="0"
            data-duration="2"
            data-track-index="0"
          >
            <div class="sp-badge">
              <span class="sp-dot" aria-hidden="true"></span>
              <span class="sp-label"></span>
            </div>
          </div>

          <script src="https://cdn.jsdelivr.net/npm/gsap@3.14.2/dist/gsap.min.js"></script>
          <script>
            (function () {
              "use strict";

              var root = document.getElementById("root");
              var badge = root.querySelector(".sp-badge");
              var label = root.querySelector(".sp-label");
              var vars =
                window.__hyperframes && window.__hyperframes.getVariables
                  ? window.__hyperframes.getVariables()
                  : {};

              // INVARIANT: invalid numeric overrides return to declared
              // defaults. Explicit finite checks preserve every valid value.
              var overshootValue = vars.overshoot;
              var fromScaleValue = vars.fromScale;
              var overshoot = Number.isFinite(overshootValue)
                ? Math.max(1.1, Math.min(2, overshootValue))
                : 1.7;
              var fromScale = Number.isFinite(fromScaleValue)
                ? Math.max(0.8, Math.min(0.97, fromScaleValue))
                : 0.9;
              var text = vars.text == null ? "New" : String(vars.text);

              label.textContent = text;

              // RETIME RANGE: tune only the fixed entrance length. HOLD is
              // deliberately still, and this reveal has no exit phase.
              var IN_BASE = 0.6;
              var duration = Math.max(0.001, parseFloat(root.dataset.duration || "2"));
              var IN = Math.min(IN_BASE, duration);
              var OPACITY_IN = Math.min(0.3, IN);

              var tl = gsap.timeline({ paused: true });

              // --ease-overshoot: the back curve owns the only scale arc. The
              // start is 0.9 by default, never 0, so the badge does not appear
              // from nothing. Opacity uses its own non-overshooting ease.
              tl.fromTo(
                badge,
                { scale: fromScale },
                { scale: 1, duration: IN, ease: "back.out(" + overshoot + ")" },
                0,
              );
              tl.fromTo(
                badge,
                { opacity: 0 },
                { opacity: 1, duration: OPACITY_IN, ease: "power2.out" },
                0,
              );
              tl.seek(0);

              window.__timelines = window.__timelines || {};
              window.__timelines["spring-pop"] = tl;
            })();
          </script>
        </div>
      </template>
    </body>
  </html>
  ```
</Accordion>

Tagged `motion-primitive` `effects` `spring` `overshoot` `pop` `reveal`.

## Related topics

* [Browse the complete Catalog](/catalog)
* [Add assets and Catalog items in Studio](/studio/assets-and-blocks)
* [Build a richer composition](/go-further)


## Related topics

- [Split Tilt Cards](/catalog/components/split-tilt-cards.md)
- [Native Notification Pop](/catalog/components/native-notification-pop.md)
- [Spring Stack Shuffle](/catalog/components/spring-stack-shuffle.md)
