miklb / web-share-button

A HTML web component for sharing links

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

web-share-button

A HTML web component for sharing links

I have been reading a lot of blog posts lately about HTML Web Components and they finally are starting to click.

So when I was reading this post from Aaron Gustafson about how he's progressively enhacing his share button, it sure sounded like what he was describing was an HTML web component.

Scott Jehl recently walked through writing a web component for responsive video and I used Stefan Judis' sparkly-text as a starting point for this project.

Usage

index.html provides a basic example using Aaron's orignal code from his demo.

Note you'll want to style your unordered list for graceful degradation. The button style is only applied if the browser supports the web component. The example uses Aaron's original CSS.

The idea is you wrap your unordered list with <web-share> </web-share> tags and the component will add the share button to each list item.

About

A HTML web component for sharing links

License:MIT License


Languages

Language:HTML 73.2%Language:JavaScript 26.8%