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

# Outline Draw

> A rounded outline that proves a callout by drawing clockwise as a hollow conic-gradient border with a clean closure.

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

## Install

<InstallCommand command="npx hyperframes add outline-draw" />

That writes one file: `compositions/components/outline-draw.html`.

## Paste it into your composition

Open `compositions/components/outline-draw.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                                           |
| ----------- | ------- | --------------------------------------- | ------------------------------------------------------ |
| `progress`  | `100`   | 0% to 100%, step 1%                     | Final percentage of the outline that is drawn.         |
| `thickness` | `6`     | 10.1cqw to 200.1cqw, step 10.1cqw       | Outline stroke in tenths of the host width.            |
| `radius`    | `24`    | 00.1cqmin to 800.1cqmin, step 10.1cqmin | Corner radius in tenths of the host smaller dimension. |

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="outline-draw"
  data-composition-src="compositions/components/outline-draw.html"
  data-variable-values='{"progress":100,"thickness":6,"radius":24}'
></div>
```

## Source

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

    Concept: a conic-gradient sector draws a rounded outline clockwise. Two
    opaque masks, clipped to the padding box and border box, are excluded to
    leave a true hollow center over whatever content is beneath the primitive.
    One mechanic, one job: visually proving or certifying a framed claim.

    Compiled-from evidence: OutlineDraw, "Border that draws with a composite
    donut," from the CSS mask research notes.

    Use when: closing a loop around proof, a selected product region, a logo
    lockup, or a UI callout. Mount it over existing content. The center remains
    transparent and the overlay never intercepts pointer input.

    Variables:
      - progress (number, 0 to 100, default 100): final drawn percentage.
      - thickness (number, default 6): stroke in tenths of host cqw.
      - radius (number, default 24): corner radius in tenths of host cqmin.

    Envelope: fixed 0.80s IN draws the outline, elastic HOLD preserves the
    completed proof, and fixed 0.40s OUT fades it. If duration is shorter than
    1.20s, IN and OUT compress proportionally and HOLD becomes zero.

    Sync point: draw-complete occurs at 0.80s into IN, scaled only when the
    whole envelope is compressed. It never moves into the elastic HOLD.

    Sound: none. A parent scene may place a static cue at draw-complete.

    Mount contract: the runtime clones only this template. The root fills the
    host box, owns the container query basis, has no intrinsic width or height,
    and registers one paused timeline under the hardcoded outline-draw id.
  -->
  <html
    lang="en"
    data-composition-variables='[
      { "id": "progress", "type": "number", "role": "timing", "label": "Draw progress", "description": "Final percentage of the outline that is drawn.", "default": 100, "min": 0, "max": 100, "step": 1, "unit": "%" },
      { "id": "thickness", "type": "number", "role": "layout", "label": "Stroke thickness", "description": "Outline stroke in tenths of the host width.", "default": 6, "min": 1, "max": 20, "step": 1, "unit": "0.1cqw" },
      { "id": "radius", "type": "number", "role": "layout", "label": "Corner radius", "description": "Corner radius in tenths of the host smaller dimension.", "default": 24, "min": 0, "max": 80, "step": 1, "unit": "0.1cqmin" }
    ]'
  >
    <head>
      <meta charset="UTF-8" />
      <title>Outline Draw</title>
    </head>
    <body>
      <template>
        <div id="root" data-composition-id="outline-draw" data-duration="4" data-fps="30">
          <style>
            @property --od-progress {
              syntax: "<number>";
              inherits: false;
              initial-value: 0;
            }

            *,
            *::before,
            *::after {
              box-sizing: border-box;
            }

            #root {
              position: absolute;
              inset: 0;
              container-type: size;
              isolation: isolate;
              overflow: hidden;
              pointer-events: none;
            }

            .od-clip {
              position: absolute;
              inset: 0;
              overflow: hidden;
            }

            /* EDIT ZONE: --space-8 controls the safe inset. The public
               thickness and radius variables own the remaining geometry. */
            .od-outline {
              --od-progress: 0;
              --od-thickness: 6;
              --od-radius: 24;
              --od-seam-overlap: 0.5deg;
              position: absolute;
              inset: var(--space-8, 8cqmin);
              border: calc(var(--od-thickness) * 0.1cqw) solid transparent;
              border-radius: calc(var(--od-radius) * 0.1cqmin);
              background: conic-gradient(
                from -90deg,
                var(--accent, #38bdf8) 0deg calc(var(--od-progress) * 3.6deg),
                transparent calc(var(--od-progress) * 3.6deg + var(--od-seam-overlap)) 360deg
              );
              background-clip: border-box;
              background-origin: border-box;
              mask:
                linear-gradient(var(--fg, #f8fafc) 0 0) padding-box,
                linear-gradient(var(--fg, #f8fafc) 0 0) border-box;
              mask-composite: exclude;
              will-change: opacity;
            }

            /* INVARIANT: the 0.5deg feather overlaps the coincident conic
               edges at closure so 0deg and 360deg never expose a hard seam. */
          </style>

          <div
            id="outline-draw-clip"
            class="od-clip clip"
            data-start="0"
            data-duration="4"
            data-track-index="0"
          >
            <div class="od-outline" data-layout-ignore aria-hidden="true"></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 outline = root.querySelector(".od-outline");
              var vars =
                window.__hyperframes && window.__hyperframes.getVariables
                  ? window.__hyperframes.getVariables()
                  : {};

              // INVARIANT: invalid values return to declared defaults. Valid
              // zero values survive because each scalar is checked explicitly.
              var progressValue = Number(vars.progress);
              var thicknessValue = Number(vars.thickness);
              var radiusValue = Number(vars.radius);
              var progress = Number.isFinite(progressValue)
                ? Math.max(0, Math.min(100, progressValue))
                : 100;
              var thickness = Number.isFinite(thicknessValue)
                ? Math.max(1, Math.min(20, thicknessValue))
                : 6;
              var radius = Number.isFinite(radiusValue) ? Math.max(0, Math.min(80, radiusValue)) : 24;

              outline.style.setProperty("--od-thickness", String(thickness));
              outline.style.setProperty("--od-radius", String(radius));

              // RETIME RANGE: only these fixed envelope lengths may be tuned.
              // HOLD is the sole elastic phase. Never use timeScale.
              var IN_BASE = 0.8;
              var OUT_BASE = 0.4;
              var duration = Math.max(0.001, parseFloat(root.dataset.duration || "4"));
              var envelope = IN_BASE + OUT_BASE;
              var scale = duration < envelope ? duration / envelope : 1;
              var IN = IN_BASE * scale;
              var OUT = OUT_BASE * scale;
              var HOLD = Math.max(0, duration - IN - OUT);
              var OUT_START = IN + HOLD;

              gsap.set(outline, { "--od-progress": 0, opacity: 1 });

              var tl = gsap.timeline({ paused: true });
              // --ease-standard maps to the production GSAP name power2.out.
              // The registered scalar is tweened directly, with no proxy clock.
              tl.to(outline, { "--od-progress": progress, duration: IN, ease: "power2.out" }, 0);
              tl.to(outline, { opacity: 0, duration: OUT, ease: "power2.out" }, OUT_START);
              tl.seek(0);

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

Tagged `motion-primitive` `effects` `outline` `border` `mask` `proof`.

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

- [Speech Bubble](/catalog/blocks/hw-text-cloud.md)
- [Scribble Callout Circle](/catalog/components/hw-callout-circle.md)
- [Review the storyboard](/studio/storyboard.md)
