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 | url size fill background circle |
TwitterShare | text url size fill background circle |
WhatsAppShare | text url size fill background circle |
RedditShare | url size fill background circle |
LinkedinShare | text url summary source size fill background circle |
PinterestShare | text url size fill background circle |
TelegramShare | text url size fill background circle |
EmailShare | text url size fill background circle |
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