Kinetik UI

Copy Chip

.md

A value with a copy button whose two pages fold into a check while a ring spreads and the outline turns green.

v1.0.0Live on webreact-native-reanimatedreact-native-worklets
Component preview

Installation

Kinetik CLI
npx kinetik-ui add copy-chip

The CLI copies the source and installs native dependencies with npx expo install, so versions match your Expo SDK. With shadcn: npx shadcn@latest add https://kinetik-ui.dev/r/copy-chip.json

Install manually

  1. Install dependencies
    npx expo install react-native-reanimated react-native-worklets
  2. Copy the source files
    • components/kinetik/copy-chip.tsx
    View source files

Usage

import * as Clipboard from 'expo-clipboard';

import { CopyChip } from '@/components/kinetik/copy-chip';

<CopyChip
  label="Invite link"
  value="kinetik.app/join/north-studio"
  onCopy={(v) => Clipboard.setStringAsync(v)}
/>;

Kinetik does not depend on a clipboard library. Pass the copy function you already use, such as setStringAsync from expo-clipboard (npx expo install expo-clipboard).

When to use

  • Values people paste somewhere else: invite links, promo codes, commands, account numbers, addresses.
  • Long values that are tedious to select by hand on a phone.

When not to use

  • Secrets that should not sit on the clipboard, such as one-time passwords for other devices.
  • Values people only need to read. Show them as text.

Notes

  • onCopy may return a promise. The chip confirms only once it resolves; if it rejects, an error haptic plays and nothing changes.
  • The copied state lasts resetAfter ms (1.6 s by default), then eases back.
  • The value is truncated to one line on screen; screen readers get all of it.
  • With reduced motion the glyph turns into a check in place.

Props

CopyChipProps

PropTypeDefaultDescription
valuerequiredstring—The text to show and copy, e.g. a command, a link or a code.
onCopyrequired(value: string) => void | Promise<unknown>—Does the copying, e.g. `(v) => Clipboard.setStringAsync(v)` from expo-clipboard.
labelstring—A short name read before the value, e.g. "Install command".
monospacebooleantrueShow the value in a monospaced face. Defaults to true.
resetAfternumber1600How long the copied state lasts, in ms. Defaults to 1600.
hapticsbooleantrueA success haptic on copy. Defaults to true.
testIDstring—
styleStyleProp<ViewStyle>—

Performance and accessibility

Performance

Budget
Plain views and three shared values; the glyph is drawn with borders. Nothing runs at rest.
Measured

Pixel 9 emulator, API 35, release build · interaction median 1.15× the system Settings app on the same emulator (indicative only) · no frames drawn at rest · 148 MB app memory

Real-device measurement pending.

Accessibility

Reduced motion
The glyph turns into a check in place, without the ring.
Screen readers
A button named "Copy" plus the label and value, whose value reads "Copied" while copied; "Copied" is also announced.
Touch target
The whole chip is the target, 48 pt tall.

Source files

components/kinetik/copy-chip.tsx is in the Code tab of the preview above.