Skip to content
Native Animation
Copy Confirm Button animation preview

This preview uses fictional demo content. See the props below for the customization options available in this component.

npx nativeanimation add copy-confirm-button
ButtonMicro

Copy Confirm Button

React Native Animated Copy Button

A copy button that draws a check and lifts a confirmation pill, with configurable confirmation text, font, surface color, and success color.

Free
Get it free with your email

No password and no card: we email you a sign-in link, then the full source is yours.

Add to your project

Copy the component and its assets into your app with the Native Animation CLI, or paste the agent prompt into Claude Code, Codex or Cursor once the MCP server is connected.

About this animation

A React Native animated button can confirm a copy action without adding a toast that competes with the surrounding interface. This compact control rotates its copy glyph into a check, flashes a success halo, sweeps light across the surface, and raises a short confirmation bubble. Use it beside code, invite links, account identifiers, addresses, or any value people frequently move to the clipboard. Reanimated coordinates the icon, halo, sweep, and bubble transitions, while Expo Linear Gradient gives the button material depth. The component deliberately does not import a clipboard package: your onCopy callback performs the actual product action. Configure controlled feedback, reset timing, size, labels, fonts, colors, and light or dark appearance.

When to use it

  • Confirm copying code or an invite link.
  • Add feedback beside a shareable identifier.
  • Replace a transient toast with local confirmation.
  • Control clipboard behavior in application code.

A copy button that draws a check and lifts a confirmation pill, with configurable confirmation text, font, surface color, and success color.

How it works

  1. A single shared progress value crossfades the two outlined copy rectangles into a check whose Skia path draws from start to finish.
  2. The same progress tints the button with the success accent, keeping the icon, surface, and confirmation state perfectly synchronized.
  3. A 1.4-second feedback timeline keeps the concise glass Copied pill 10 points clear of the button, then drifts it upward as it fades.
  4. Press-in scales immediately to 0.94; release returns to 1 with a damped spring for a visual haptic response.
  5. The component calls onCopy instead of owning a clipboard dependency, so consumers can use expo-clipboard, a native bridge, or a simulated demo.

Why this one

Most copy buttons stop at an icon swap or a detached toast. This version keeps every response at the point of action: the two rectangles resolve into a genuinely drawn check, the material itself takes on the accent, and a compact glass label appears above the button without covering nearby content. The result confirms the action without shifting layout or making the user hunt for feedback.

Install

npx expo install @shopify/react-native-skia expo-blur expo-linear-gradient react-native-reanimated react-native-worklets

Usage

import * as Clipboard from 'expo-clipboard';
import { CopyConfirmButton } from './CopyConfirmButton';

<CopyConfirmButton onCopy={() => Clipboard.setStringAsync(value)} />;

<CopyConfirmButton
  size={56}
  backgroundColor="#292735"
  colorScheme="dark"
  iconColor="#F4F4F8"
  successColor="#765EFF"
  copiedLabel="Copied"
  resetMs={1400}
  onCopy={() => Clipboard.setStringAsync(value)}
/>;

Props

PropTypeDefaultDescription
blurTargetReact.RefObject<View | null>undefinedAndroid backdrop ref. Wrap host content behind the component in BlurTargetView and pass its ref; keep the blur outside that target.
copiedboolean—Controls the confirmation state externally.
defaultCopiedbooleanfalseSets the initial uncontrolled state.
onCopy() => voidRequiredPerforms the application's copy operation.
onChange(copied: boolean) => void—Receives requested confirmation-state changes.
resetMsnumber1400Time before uncontrolled feedback resets.
sizenumber52Square button size in points.
backgroundColorstringScheme-awareResting button color.
surfaceEndColorstringSame as backgroundColorAlternate resting surface color retained for API compatibility.
iconColorstringScheme-awareResting copy icon color.
successColorstring'#6E56FF'Success surface, dot, and glow color.
copiedLabelstring'Copied'Confirmation-pill text.
fontFamilystringSystem fontConfirmation-pill font family.
colorScheme'light' | 'dark' | 'auto''auto'Surface and glass treatment.
accessibilityLabelstring'Copy value'Screen-reader action label.
styleStyleProp<ViewStyle>—Button-container style.
testIDstring—Test identifier.

The forwarded ref exposes copy() and reset() for guided demos and external controls.

Compatibility

Built for Expo SDK 58, React Native 0.88, Reanimated 4.7, and React Native Skia 2.14. Supports iOS, Android, and web. The included dependencies work in Expo Go for SDK 58.

Accessibility

The control exposes a labeled button and a selected confirmation state. The label updates to announce success. With Reduce Motion enabled, the icon and surface crossfade without travel, the glow and text shimmer are removed, and the confirmation pill remains stationary with a 10-point gap above the button.

For Android blur, wrap the backdrop in BlurTargetView from expo-blur, create its ref with useRef<View | null>(null), and pass that ref as blurTarget. The target must cover the blur bounds and exclude the blur itself. Without a target, the existing tint/background remains the fallback. dimezisBlurViewSdk31Plus enables blur on Android 12 and newer while keeping the fallback on older Android versions.

Customization notes

resetMs controls how long confirmation remains visible. Press and checkmark feedback use interruptible springs.

FAQ

Does the animated copy button work in Expo Go?
Yes. Expo Linear Gradient and Reanimated are available in Expo SDK 58 and Expo SDK 57. Each published piece is reviewed on physical iPhone and Android devices with Expo Go before release.
Does the component write to the clipboard itself?
No. It calls the required onCopy callback, so you choose the clipboard implementation. You can also control copied state or let the feedback reset after resetMs.
What changes when Reduce Motion is enabled?
The icons crossfade and the confirmation bubble appears in place without rotation or travel. The button retains its label and selected feedback state.

Source code

Free with an account

Sign in with your email to read the full source here, or install it in one command with the CLI.

Get it free