Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

loltgt/ensemble-social-share

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

55 Commits

Repository files navigation

ensemble SocialShare

ensemble.SocialShare JavaScript class, based on ensemble from loltgt

This social sharing component has buttons to share on popular socials and supports the WebShare API.

It has copy link to clipboard and send to e-mail buttons.

It comes with options and hooks to customize.

Demo

Live demo on this page: https://loltgt.github.io/ensemble-social-share/demo/

View source from demo to discover options and examples.

Install

Using npm:

npm install --save-dev loltgt/ensemble-social-share

Usage

Simple usage example:

new ensemble.SocialShare(document.querySelector("[data-social-share]"),
 {
 intents: ["send-email", "copy-link", "web-share"]
 }
);

Another example, vertical layout and a custom share button:

new ensemble.SocialShare(document.querySelector("[data-social-share]"),
 {
 layout: "v",
 intents: ["custom-button", "web-share"],
 onIntent: (self, event, intent, data) =>
 intent === "custom-button" && alert("custom share button")
 }
);

License

MIT License

AltStyle によって変換されたページ (->オリジナル) /