open-index/open-npm huggingface dataset:
npm package: @slushman/share-button
Description: An HTML button that opens a native share sheet or copies the sharing message to your clipboard.
Latest version: 1.1.0

# @slushman/share-button

An HTML button that opens a native share sheet or copies the sharing message to your clipboard.

## Installation

Install with your preferred package manager.

```bash
yarn add @slushman/share-button
or
npm install @slushman/share-button
```

## Dependencies

- React
- css.gg
- Tailwind

## Example usage

```js
import { ShareButton } from "@slushman/share-button";

<ShareButton
  shareContent="Example share content that can be as long as you prefer."
  shareTitle="Example Title"
/>;
```

## Props

### classes

Optional object to customize the Tailwind classes on each element. The options are:

- button
- icon

### buttonLabel

Optional label for the button. The default value is 'Share'.

### onCopyToClipboard

Optional function that runs if the device does not have a native share sheet.
In this case, the shareContent is copied to the clipboard, then this function
runs.

### onNoShare

Optional function that runs if the device does not neither a native share sheet
nor a cliboard.

### shareContent

Required string. The content shared in the share sheet or clipboard.

### shareTitle

Required string. The title used for the share sheet.