npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-native-clipboard-toast

v1.1.0

Published

React Native Clipboard API with Animated toast message component

Readme

npm version npm downloads npm stars npm license

react-native-clipboard-toast

React Native Clipboard API with Animated toast message component


Support both Android and iOS | Uses @react-native-clipboard/clipboard | Toast by calling api

react-native-clipboard-toast-gif

Install

npm install react-native-clipboard-toast @react-native-clipboard/clipboard

or

yarn add react-native-clipboard-toast @react-native-clipboard/clipboard

Note: @react-native-clipboard/clipboard is a peer dependency. For iOS, run cd ios && pod install after installing.


Import the package
import ClipboardToast from 'react-native-clipboard-toast';

or

import { ClipboardToast } from 'react-native-clipboard-toast';
Basic usage
<ClipboardToast
  textToShow="Tap to copy this text"
  textToCopy="Hello, World!"
  toastText="Copied to clipboard!"
  containerStyle={{ backgroundColor: '#DDDDDD', padding: 10, borderRadius: 5 }}
  textStyle={{ fontSize: 18, color: '#223345' }}
  toastPosition="top"
/>
With custom children
<ClipboardToast
  textToCopy="some-secret-code-123"
  toastText="Code copied!"
  toastPosition="center"
  onCopySuccess={(text) => console.log('Copied:', text)}
>
  <View style={{ flexDirection: 'row', alignItems: 'center' }}>
    <Icon name="copy" size={16} />
    <Text style={{ marginLeft: 8 }}>Copy code</Text>
  </View>
</ClipboardToast>
With callbacks
<ClipboardToast
  textToShow="Copy with feedback"
  textToCopy="Important text"
  toastText="Copied!"
  onCopySuccess={(text) => analytics.track('copied', { text })}
  onCopyError={(error) => console.error('Copy failed:', error)}
/>

Reference

Props

| Name | Default | Type | Description | |------|---------|------|-------------| | textToShow | - | string | The text that will show (clickable). Not needed if using children. | | textToCopy | (required) | string | The text that will be copied to the clipboard | | toastText | 'Text is copied' | string | The text that will show on the toast | | containerStyle | - | StyleProp<ViewStyle> | Container style | | textStyle | - | StyleProp<TextStyle> | Text style (only used when not using children) | | id | - | string \| number | Key of element | | accessibilityLabel | - | string | Accessibility label text | | toastDuration | 750 | number | The duration of the toast (milliseconds) | | toastPosition | 'bottom' | 'top' \| 'center' \| 'bottom' | The position of toast on screen | | toastDelay | 0 | number | Delay before toast appears (milliseconds) | | toastAnimation | true | boolean | Animate toast show/hide | | toastHideOnPress | true | boolean | Hide toast when pressed | | toastBackgroundColor | - | string | Background color of the toast | | toastTextColor | - | string | Text color of the toast | | toastOpacity | - | number | Opacity of the toast (0-1) | | toastShadowColor | - | string | Shadow color of the toast | | toastOnShow | - | () => void | Callback when toast appears | | onCopySuccess | - | (text: string) => void | Callback after text is copied successfully | | onCopyError | - | (error: Error) => void | Callback if copy fails | | disabled | false | boolean | Disable the copy action | | children | - | ReactNode | Custom content instead of plain text |

Changelog

1.1.0

  • Migrated from deprecated Clipboard (react-native) to @react-native-clipboard/clipboard
  • Removed prop-types dependency (TypeScript handles type checking)
  • Fixed toast duration bug (was hardcoded to LONG regardless of toastDuration prop)
  • Added children prop for rendering custom content (icons, styled views, etc.)
  • Added onCopySuccess and onCopyError callbacks
  • Added disabled prop
  • Added toastOpacity and toastShadowColor props
  • Improved TypeScript types (ViewStyle, TextStyle instead of any)
  • Added named export: import { ClipboardToast } from 'react-native-clipboard-toast'
  • Improved accessibility (accessibilityRole="button", accessibilityState)
  • Performance improvements with useCallback

1.0.0

  • Initial release

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Author

Made by Idanlevi1.