Sharer
Opens a social media sharer window with prefilled URL and text or copies the page URL to the clipboard.
<span>Share on:</span>
<button ob-sharer="type: facebook">Facebook</button>
<button ob-sharer="type: twitter">Twitter</button>
<button ob-sharer="type: linkedin">LinkedIn</button>
<button ob-sharer="type: reddit">Reddit</button>
<button ob-sharer="type: pinterest">Pinterest</button>
<button ob-sharer="type: copy">Copy URL</button>
import { Watcher } from 'oblik'
import { Sharer } from 'oblik/components/sharer'
let w = new Watcher(document.body, {
components: {
sharer: Sharer
}
})
w.init()
# Options
#
type
Which social media sharer to invoke:
Can also be set to copy
to copy the URL to the clipboard instead.
Default: undefined
#
url
What URL to share.
Default: window.location.href
#
text
What text to share. Only available for twitter
, reddit
, and pinterest
.
Default: document.title
#
image
What image to share. Only available for pinterest
.
Default: undefined
#
width
Width of the opened popup window.
Default: 600
#
height
Height of the opened popup window.
Default: 400