@antadesign/anta
    Preparing search index...

    Function ButtonCopyUnreviewed

    • Copy button — a Button preset for copy-to-clipboard. Set copy for a literal string, copyNode to copy a DOM region, or copyUrl to copy the current page URL. For dynamic text, pass a controlled copy string and set it in onCopyRequest before activation.

      It composes a plain <Button> with a slotted <a-copy> child that performs the write — the button itself carries no copy behavior. This wrapper flips the copy glyph to a check (success) or ✕ (failure) and retones to success / critical for ~2s (a re-render, no element state — see useCopyFeedback). iconPlacement puts that glyph leading (default), trailing, or 'none'; with 'none', <a-copy> shows its Copied confirmation instead.

      With a label it's a labeled button; without one it's an icon-only copy button (named "Copy" for assistive tech). Everything else is a normal Button prop — tone, priority, size, icon (the resting glyph), onCopied.

      Parameters

      Returns any

      <ButtonCopy copy="npm i @antadesign/anta" label="Copy install" />
      <ButtonCopy copy="https://anta.design" /> // icon-only
      <ButtonCopy copy={code} label="Copy" iconPlacement="trailing" />
      <ButtonCopy copy={code} label="Copy snippet" iconPlacement="none" copiedLabel="Copied" />
      <ButtonCopy copyNode=".snippet" label="Copy block" priority="tertiary" />
      <ButtonCopy copyUrl label="Copy link" /> // copies location.href