How to add copy to clipboard to your Expo app, in short
Use expo-clipboard. Install it with npx expo install expo-clipboard, import it with import * as Clipboard from 'expo-clipboard', and call await Clipboard.setStringAsync(value) when the user taps a copy button. Then tell the user it worked, with a short "Copied" label or toast. To read what is on the clipboard, call await Clipboard.getStringAsync(), which resolves to a string.
That covers the copy button most apps need: a referral code, an invite link, an order number, a generated caption. The parts that decide whether it feels right are the rest: what happens on iOS when your app reads the clipboard, the native paste button, copying images and links, and keeping secrets out of keyboard previews on Android. That is what this guide covers.
Step 1: Install expo-clipboard
- Install: npx expo install expo-clipboard. Using expo install picks the version that matches your SDK.
- Import: import * as Clipboard from 'expo-clipboard'.
- Start testing in Expo Go. The expo-clipboard reference lists it as included in Expo Go, on Android, iOS and web.
- No config plugin or permission entry to add for copying. Writing to the clipboard does not show a prompt.
Compare that with device features like the camera or location, where you need usage descriptions and a permission request; see [how to request permissions in your Expo app](/blog/how-to-request-permissions-in-your-expo-app) for those. The clipboard only gets interesting when you read from it, which is Step 3.
Step 3: Read the clipboard, and the iOS paste prompt
Reading is where iOS changes the rules. Apple's UIPasteControl documentation says that in iOS 16 and later, programmatic pasting raises an alert that asks the user for approval before the app gets the clipboard contents. So if your screen calls getStringAsync on load, iPhone users can see a system prompt the moment they arrive, before they have done anything. That feels intrusive, and it is the most common clipboard mistake in shipped apps.
The expo-clipboard reference adds the second half of the problem: on iOS 16 and later, if the user denies paste permission, getStringAsync returns an empty string, and there is no way to tell an empty clipboard from a denied one. getImageAsync and getUrlAsync return null in the same situation. Your code has to treat "nothing came back" as a normal outcome, not an error.
Reading the clipboard in Expo
| Method | Returns | When nothing is available or access is denied |
|---|---|---|
| getStringAsync() | Promise of a string | Empty string |
| getImageAsync({ format: 'png' }) | Promise of a ClipboardImage or null | null |
| getUrlAsync() (iOS) | Promise of a string or null | null |
| hasStringAsync() / hasImageAsync() | Promise of a boolean | false |
My recommendation: only read the clipboard in direct response to the user, such as a Paste button they tapped, never automatically on screen load. On web, the reference notes that reading also asks the user for permission to see text and images copied to the clipboard, so the same rule keeps your app consistent across platforms.
Step 5: Copy images and links
- Images: Clipboard.setImageAsync(base64) takes a base64 string without the MIME prefix. The reference's own example gets that string from expo-image-picker with base64: true; see [how to add an image picker to your Expo app](/blog/how-to-add-an-image-picker-to-your-expo-app).
- Reading images: getImageAsync({ format: 'png' }) or { format: 'jpeg', jpegQuality: 0.8 } returns an object whose data string already includes the data:image prefix, so you can pass it straight to an Image source uri.
- Links on iOS: setUrlAsync(url) works like setStringAsync but marks the content as a URL, which lets other apps treat it as one. It is listed for iOS and macOS, so use setStringAsync on Android.
- Rich text: setStringAsync accepts an inputFormat option of StringFormat.HTML, and getStringAsync accepts preferredFormat, for apps that copy formatted text.
For sending a whole file or link to another app, the share sheet is usually a better experience than the clipboard; see [how to add a share sheet to your Expo app](/blog/how-to-add-a-share-sheet-to-your-expo-app). Offer both on an invite screen: Copy link for people who want to paste it somewhere specific, Share for everyone else.
Step 6: Handle secrets carefully
If your app copies a password, one-time code, API token, recovery key or payment detail, pass the Android sensitive flag: await Clipboard.setStringAsync(token, { android: { isSensitive: true } }). The expo-clipboard reference says this sets Android's EXTRA_IS_SENSITIVE flag, which on Android 13 and later stops the clipboard preview overlay from showing the content and signals keyboards to avoid showing it in clipboard suggestions. setImageAsync takes the same option.
Mistakes that make clipboard features feel broken
- Reading the clipboard on screen load, which can trigger the iOS paste prompt before the user did anything.
- Treating an empty string from getStringAsync as an error. On iOS 16 and later it can simply mean the user denied the paste prompt.
- Copying with no visible confirmation.
- Rendering ClipboardPasteButton without a width and height, so it never appears.
- Styling the paste button with backgroundColor or borderRadius in style instead of its own props.
- Using the old Clipboard export from react-native. React Native's docs mark it as removed and point to community packages; in an Expo app, use expo-clipboard.
- Copying tokens or codes without android.isSensitive, so they show up in keyboard clipboard previews.
Have Claude Code set it up for you
Open your project in the Claude Code desktop app and be specific about where reads happen. Left to its own judgment, AI-written code often reads the clipboard in a useEffect to "helpfully" prefill a field, which is exactly what triggers the iOS prompt. A prompt that covers it:
Then add a line to your [CLAUDE.md](/blog/claude-md-for-expo-apps) such as "clipboard uses expo-clipboard; only read the clipboard on an explicit user tap; secrets use android.isSensitive" so a later session does not undo it. Test on a real iPhone running iOS 16 or later: tap Paste, deny the prompt once, and make sure the screen handles it calmly.
The short version
To add copy to clipboard to your Expo app: install expo-clipboard, call setStringAsync from a button press, and show a clear "Copied" confirmation. Only read the clipboard when the user taps something, expect an empty string when iOS paste access is denied, use ClipboardPasteButton where it is available, and mark secrets with android.isSensitive.
If you are building your first iOS app with Claude Code and Expo and want a second pair of eyes on it before App Review, bring it to App Store Launch Club. Members share their builds for feedback, and the [curriculum](/curriculum) covers the full path from first build to first users. Join at applaunchclub.co for $9 a month.
Short, practical drops on app ideas, validating fast, store listings, and passing app review. No spam, unsubscribe anytime.
Frequently asked questions
How do I copy text to the clipboard in Expo?
Install expo-clipboard, import it with import * as Clipboard from 'expo-clipboard', and call await Clipboard.setStringAsync(text) from a button press. Show a short confirmation so the user knows it worked.
Does expo-clipboard work in Expo Go?
Yes. The expo-clipboard reference lists it as included in Expo Go, and it works on Android, iOS and web.
Why does my Expo app show an Allow Paste prompt on iOS?
In iOS 16 and later, reading the clipboard from code asks the user for approval. Only read the clipboard when the user taps a paste control, or use ClipboardPasteButton, which pastes without the prompt.
Why does Clipboard.getStringAsync return an empty string?
Either the clipboard is empty or, on iOS 16 and later, the user denied paste access. The expo-clipboard reference says there is no way to tell the two apart, so treat an empty string as nothing to paste.
Can I copy an image to the clipboard in Expo?
Yes. Call Clipboard.setImageAsync with a base64 string without the MIME prefix, for example from expo-image-picker with base64: true. Read images back with getImageAsync({ format: 'png' }).
Should I use the Clipboard API from react-native?
No. React Native's docs mark its Clipboard API as removed. In an Expo app, use expo-clipboard instead.
How do I stop copied passwords showing in keyboard previews on Android?
Pass android: { isSensitive: true } to setStringAsync or setImageAsync. On Android 13 and later this hides the clipboard preview overlay and signals keyboards not to show the content.
Last reviewed by David on October 20, 2026

