This package has been deprecated

Author message:

This package has been moved to @w0s/button-share

@saekitominaga/customelements-button-share
TypeScript icon, indicating that this package has built-in type declarations

1.2.4 • Public • Published

Share button

npm version test status

Share button using Web Share API.

Demo

Examples

<button type="button" is="x-share"
  data-share-text="Message text"
  data-share-title="Page title"
  data-share-url="/path/to"
>Share</button>

Attributes

type [optional]
This function automatically sets type="button". However, it is recommended to manually add type="button" for JavaScript disabled environments and browsers that do not support Customized built-in elements (Safari 16, etc.). According to the description in the HTML specification, The missing value default and invalid value default are the Submit Button state.
data-share-text [optional]
Arbitrary text that forms the body of the message being shared. If omitted, it will be an empty string.
data-share-title [optional]
The title of the document being shared. May be ignored by the target. If omitted, the value of document.title will be set.
data-share-url [optional]
A URL string referring to a resource being shared. The url can contain a relative-URL string. If omitted, the value of document.URL will be set.

Package Sidebar

Install

npm i @saekitominaga/customelements-button-share

Weekly Downloads

0

Version

1.2.4

License

MIT

Unpacked Size

41.3 kB

Total Files

7

Last publish

Collaborators

  • saekitominaga