> ## 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.

# Success Check

> A success check primitive with ring pop, path draw, and subtle rotate blur

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="success-check 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/success-check.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/success-check.png");document.body.appendChild(p)});<\/script></body></html>`} />

## Install

<InstallCommand command="npx hyperframes add success-check" />

That writes one file: `compositions/components/success-check.html`.

## 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                                                                                                                                    |
| -------- | ---------- | ---------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| `tint`   | `green`    | `green`, `blue`, `violet`, `amber` | Colour pair, a pale halo behind a saturated mark. green and amber are literal state colours; blue and violet ride the composition theme tokens. |
| `size`   | `standard` | `small`, `standard`, `large`       | Diameter of the halo and of the mark inside it.                                                                                                 |
| `ring`   | `standard` | `subtle`, `standard`, `bold`       | Opacity of the circle the tick sits in.                                                                                                         |
| `spin`   | `standard` | `subtle`, `standard`, `bold`       | Multiplies the rotation the timeline drives, so the mark swings less or more into place.                                                        |

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="success-check"
  data-composition-src="compositions/components/success-check.html"
  data-variable-values='{"tint":"green","size":"standard","ring":"standard","spin":"standard"}'
></div>
```

## Source

<Accordion title={`success-check.html`}>
  ```html theme={null}
  <!--
    Success Check - transitions.dev-inspired primitive for HyperFrames.

    Paste the markup, CSS and script into a composition. Use the timeline
    integration note at the bottom as the starting point for deterministic GSAP
    animation.

    Variables. The script reads each one, falls back to the declared default on
    anything missing or unrecognised, and writes the result as a custom property
    the CSS below consumes. The timeline recipe at the bottom is untouched by
    them: it keeps popping the mark in and drawing the tick, and these decide how
    big it is, what colour it wears and how far the pop swings.

      - tint (green | blue | violet | amber, default green): the colour pair, a
        pale halo behind a saturated mark. green and amber are literal state
        colours and stay legible whatever the surrounding theme tokens hold; blue
        and violet name no state, so their mark rides the composition's own accent
        and accent-2 tokens over a neutral halo and falls back to ink when the
        composition declares none.
      - size (small | standard | large, default standard): diameter of the halo
        and of the mark inside it, 60px, 82px or 110px. The stroke is in viewBox
        units, so it thickens with the mark instead of staying pinned.
      - ring (subtle | standard | bold, default standard): opacity of the circle
        the tick sits in, 0.12, 0.28 or 0.6.
      - spin (subtle | standard | bold, default standard): multiplies the rotation
        the timeline drives, so the mark swings a quarter as far or twice as far
        into place. It scales what is already there rather than replacing it, so
        it still lands square at the end of the pop, and at rest, with no rotation
        driven, all three settle identically.

    On every default the result is identical to the original: an 82px pale green
    halo, a green tick, a 0.28 ring, and the authored -18deg pop.
  -->

  <div
    class="hf-transition-success-check"
    aria-label="Success"
    data-composition-variables='[
      { "id": "tint", "type": "enum", "role": "style", "label": "Tint", "description": "Colour pair, a pale halo behind a saturated mark. green and amber are literal state colours; blue and violet ride the composition theme tokens.", "default": "green", "options": [{ "value": "green", "label": "Green" }, { "value": "blue", "label": "Blue" }, { "value": "violet", "label": "Violet" }, { "value": "amber", "label": "Amber" }] },
      { "id": "size", "type": "enum", "role": "layout", "label": "Size", "description": "Diameter of the halo and of the mark inside it.", "default": "standard", "options": [{ "value": "small", "label": "Small" }, { "value": "standard", "label": "Standard" }, { "value": "large", "label": "Large" }] },
      { "id": "ring", "type": "enum", "role": "style", "label": "Ring", "description": "Opacity of the circle the tick sits in.", "default": "standard", "options": [{ "value": "subtle", "label": "Subtle" }, { "value": "standard", "label": "Standard" }, { "value": "bold", "label": "Bold" }] },
      { "id": "spin", "type": "enum", "role": "motion", "label": "Spin", "description": "Multiplies the rotation the timeline drives, so the mark swings less or more into place.", "default": "standard", "options": [{ "value": "subtle", "label": "Subtle" }, { "value": "standard", "label": "Standard" }, { "value": "bold", "label": "Bold" }] }
    ]'
  >
    <svg viewBox="0 0 64 64">
      <circle cx="32" cy="32" r="27" />
      <path d="M20 33.5l8 8L45 23" />
    </svg>
  </div>

  <style>
    .hf-transition-success-check {
      display: grid;
      place-items: center;
      width: var(--hf-check-size, 82px);
      height: var(--hf-check-size, 82px);
      border-radius: 999px;
      background: var(--hf-check-halo, #dcfce7);
      color: var(--hf-check-ink, #16a34a);
    }
    .hf-transition-success-check svg {
      width: var(--hf-check-mark-size, 64px);
      height: var(--hf-check-mark-size, 64px);
      fill: none;
      stroke: currentColor;
      stroke-width: 5;
      stroke-linecap: round;
      stroke-linejoin: round;
      filter: blur(var(--hf-check-blur, 0px));
      transform: rotate(calc(var(--hf-check-rotate, 0deg) * var(--hf-check-spin, 1)))
        scale(var(--hf-check-scale, 1));
    }
    .hf-transition-success-check circle {
      opacity: var(--hf-check-ring-opacity, 0.28);
    }
    .hf-transition-success-check path {
      stroke-dasharray: 36;
      stroke-dashoffset: var(--hf-check-dash, 0);
    }
  </style>

  <script>
    (function () {
      "use strict";

      var vars =
        window.__hyperframes && window.__hyperframes.getVariables
          ? window.__hyperframes.getVariables()
          : {};

      // Unrecognised overrides return to their declared defaults.
      // The mark is the whole composition and its colour is its meaning, so this
      // is the one place an accent belongs. green and amber are the literal
      // success and caution conventions; blue and violet named no state, so they
      // ride the composition's own tokens over a neutral halo and fall back to
      // ink when the composition declares none.
      var tints = {
        green: { halo: "#dcfce7", ink: "#16a34a" },
        blue: { halo: "#f4f4f5", ink: "var(--accent, #18181b)" },
        violet: { halo: "#f4f4f5", ink: "var(--accent-2, #18181b)" },
        amber: { halo: "#fef3c7", ink: "#d97706" },
      };
      var sizes = {
        small: { box: "60px", mark: "47px" },
        standard: { box: "82px", mark: "64px" },
        large: { box: "110px", mark: "86px" },
      };
      var rings = { subtle: "0.12", standard: "0.28", bold: "0.6" };
      var spins = { subtle: "0.4", standard: "1", bold: "2" };

      function pick(table, value, fallback) {
        return Object.prototype.hasOwnProperty.call(table, value) ? value : fallback;
      }

      var tint = tints[pick(tints, vars.tint, "green")];
      var size = sizes[pick(sizes, vars.size, "standard")];
      var ring = rings[pick(rings, vars.ring, "standard")];
      var spin = spins[pick(spins, vars.spin, "standard")];

      var roots = document.querySelectorAll(".hf-transition-success-check");
      for (var i = 0; i < roots.length; i += 1) {
        roots[i].style.setProperty("--hf-check-halo", tint.halo);
        roots[i].style.setProperty("--hf-check-ink", tint.ink);
        roots[i].style.setProperty("--hf-check-size", size.box);
        roots[i].style.setProperty("--hf-check-mark-size", size.mark);
        roots[i].style.setProperty("--hf-check-ring-opacity", ring);
        roots[i].style.setProperty("--hf-check-spin", spin);
      }
    })();
  </script>

  <!--
    Timeline integration:
    tl.fromTo('.hf-transition-success-check svg', { opacity: 0, '--hf-check-scale': 0.72, '--hf-check-rotate': '-18deg', '--hf-check-blur': '7px' }, { opacity: 1, '--hf-check-scale': 1, '--hf-check-rotate': '0deg', '--hf-check-blur': '0px', duration: 0.34, ease: 'back.out(1.8)' }, startTime); tl.fromTo('.hf-transition-success-check path', { '--hf-check-dash': 36 }, { '--hf-check-dash': 0, duration: 0.42, ease: 'power2.out' }, startTime + 0.12);
  -->
  ```
</Accordion>

## Usage

Open `compositions/components/success-check.html` and paste its contents into your composition. See the comment header in the file for detailed instructions.

Tagged `video-primitive` `transition-primitive` `transitions-dev-port` `success` `check`.

## 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

- [Micro Transitions](/catalog/components/micro-transitions.md)
- [CLI](/packages/cli.md)
- [Variables and templating](/prompting/variables-and-templating.md)
