Facebook button as Web Components.
Using npm:
$ npm install facebook-button
Import and register scripts.
<script type="module">
import { FacebookLikeButton } from 'https://unpkg.com/facebook-button/dist/facebook-like-button.js';
import { FacebookShareButton } from 'https://unpkg.com/facebook-button/dist/facebook-share-button.js';
customElements.define('facebook-like-button', FacebookLikeButton);
customElements.define('facebook-share-button', FacebookShareButton);
</script>
Just put <facebook-like-button>
and <facebook-share-button>
element in your HTML.
<facebook-like-button></facebook-like-button>
<facebook-share-button></facebook-share-button>
href
: required string, URL to like or sharelayout
: string, must be eitherbutton_count
,button
orbox_count
, default tobutton
size
: string, must be eithersmall
orlarge
, default tosmall
width
: number, width of<facebook-like-button>
action
: string,like
orrecommend
, default tolike
href
: required string, URL to like or sharelayout
: string, must be eitherbutton_count
,button
orbox_count
, default tobutton
size
: string, must be eithersmall
orlarge
, default tosmall
width
: number, width of<facebook-share-button>