Skip to content

Commit

Permalink
Read Me file
Browse files Browse the repository at this point in the history
  • Loading branch information
idan levi committed Mar 29, 2021
2 parents fd9312b + 8527903 commit 9a08372
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 16 deletions.
79 changes: 64 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,76 @@
# react-native-clipboard-toast
<h1 align="center">
<img src=".clipboard-toast-icon.png"/><br/>
</h1>

Clipboard with toast
[![npm version](https://img.shields.io/npm/v/react-native-clipboard-toast.svg)](https://www.npmjs.com/package/react-native-clipboard-toast)
[![npm downloads](https://img.shields.io/npm/dw/react-native-clipboard-toast.svg)](https://www.npmjs.com/package/react-native-clipboard-toast)
[![npm downloads](https://img.shields.io/bundlephobia/min/react-native-clipboard-toast.svg)](https://www.npmjs.com/package/react-native-clipboard-toast)

## Installation

```sh
npm install react-native-clipboard-toast
```
# react-native-clipboard-toast
#### React Native Clipboard API with Animated toast message component
---

## Usage
Support both Android and iOS | Used react native Clipboard | Toast by calling api

```js
import ClipboardToast from "react-native-clipboard-toast";
![react-native-clipboard-toast-gif](https://media.giphy.com/media/cEeHGUr3wBEXwpF9ev/giphy.gif)

### Install

`npm install react-native-clipboard-toast`

or

`yarn add react-native-clipboard-toast`

-------

// ...
##### **Import the package**

const result = await ClipboardToast.multiply(3, 7);
```import ClipboardToast from 'react-native-clipboard-toast';```

##### **Calling api**

```js
<ClipboardToast
textToShow={`Top toast with 1 second delay`}
textToCopy={"Top text"}
toastText={"Text copied to clipboard!"}
id={'top'}
containerStyle={{backgroundColor: "#DDDDDD", padding: 10, borderRadius: 5}}
textStyle={{ fontSize: 18, color: "#223345" }}
accessibilityLabel={"click me to copy"}
toastPosition={'top'}
toastDelay={1000}
toastOnShow={()=>{console.log('Is Copied')}}
/>
```

## Contributing
---

## Reference

### Props

Name | Default | Type | Description
--------------------|--------------------------|----------|---------------------------
textToShow | null | String | The text that will show (clickabily)
textToCopy | null | String | The text that will be copied to the clipboard
toastText | 'Text is copied' | String | The text that will show on the toast
containerStyle | null | | Style | Container style
textStyle | null | | Style | Text style
id | 'someKey' | Number/String | Key of element
accessibilityLabel | null | String | Accessibility label text
toastDuration | 750 | Number | The duration of the toast. (milliseconds)
toastPosition | 'bottom' | string | The position of toast showing on screen (there are 3 options - 'bottom, 'center' and 'top')
toastDelay | 0 | Number | The delay duration before toast start showing on screen.
toastAnimation | true | Bool | Should preform an animation on toast showing or disappearing.
toastHideOnPress | true | Bool | Should hide toast that showing by pressing on the toast.
toastBackgroundColor | null | String | The background color of the toast.
toastTextColor | null | String | The text color of the toast.
toastOnShow | null | Function | Callback for toast\`s appear animation start

See the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.

## License
## Author

MIT
Made by [Idanlevi1](https://github.com/idanlevi1).
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"release": "release-it",
"example": "yarn --cwd example",
"pods": "cd example && pod-install --quiet",
"bootstrap": "yarn example && yarn && yarn pods"
"bootstrap": "yarn example && yarn && yarn pods",
"commit-postfix": " --no-verify"
},
"keywords": [
"react-native",
Expand Down

0 comments on commit 9a08372

Please sign in to comment.