Polymorphic Sharing Buttons
Renders a collection of social sharing buttons, accessing the Newsnet API to get the relevant data of the defined article.
Installation
yarn add ta-react-polymorphic-share-buttons
Usage
import PolymorphicShareButtons from 'ta-react-polymorphic-share-buttons';
//...
class YourComponent extends React.Component {
render() {
return (
<PolymorphicShareButtons
articleID='34511213'
hashtags={['TAGrafik', 'ddj']}
displayType='horizontal icons'/>
)
}
}
API – 1.0
Props
Property | Type | Required | Default | Description |
---|---|---|---|---|
articleID |
string |
yes | – | The article ID of the link article. |
displayType |
One of 'horizontal icons' or 'vertical buttons' | no | 'vertical buttons' | How the links are rendered. Currently supported: Stacked buttons or horizontal icons with share count. |
inverted |
bool |
no | false |
Used when icon list is displayed on dark backgrounds. |
hashtags |
[string] |
no | Array of strings to be used as hashtags when sharing. |
Remarks
Fallback
In case the article with the given ID can't be found, the component will fall back to sensible defaults and still provide sharing buttons.
Display Type
Currently available values:
- 'horizontal icons'
- 'vertical buttons'