preact-social
v1.0.6
Published
A library of social sharing buttons for preact projects
Downloads
19
Readme
preact-social
A library of social sharing buttons for preact projects
Install
$ npm install --save preact-social
Usage
import { h } from 'preact';
import {FacebookShare, TwitterIcon} from 'preact-social';
// Share icon
<FacebookShare
url={url}
size={size}
fill='#fff'
background='#3B5998'
circle
/>
// Renders only the icon
<TwitterIcon
size={size}
fill='#fff'
/>
Supported Share Icons
| Share Icon | Properties | |----------|-------------| | FacebookShare | urlsizefillbackgroundcircle | | TwitterShare | texturlsizefillbackgroundcircle | | WhatsAppShare | texturlsizefillbackgroundcircle | | RedditShare | urlsizefillbackgroundcircle | | LinkedinShare | texturlsummarysourcesizefillbackgroundcircle | | PinterestShare | texturlsizefillbackgroundcircle | | TelegramShare | texturlsizefillbackgroundcircle | | EmailShare | texturlsizefillbackgroundcircle |
Properties
url
Type: String
Default: none
size
Type: Integer
Default: 32
The size
attribute defines the size of the social icons.
fill
Type: Hex
Default: #000
The fill
attribute specifies the color of the icons.
background
Type: Hex
Default: #000
The background
attribute specifies the color of the icon background (parent element).
circle
Type: true
Default: false
The circle
attribute, when passed, renders the icons in a circular container.
License
MIT © Varun A P
Acknowledgements
- Icons from Simple Icons