nygardk / react-share

Social media share buttons and share counts for React
MIT License
2.64k stars 433 forks source link

How to add custom icon #124

Closed Pardeep94 closed 6 years ago

Pardeep94 commented 6 years ago

I want to add custom icon of share and I also want to edit title and description of showing on facebook

aautio commented 6 years ago

If you want to use a custom image for the share button, then just add a img or svg. You can do something like this:

import React from 'react';
import { render } from 'react-dom';

import {
  FacebookIcon,
  FacebookShareButton,
} from 'react-share'

const App = () => (
  <div>
    <FacebookShareButton quote='Show me the Google!' url={'https://www.google.com'}>
      <img src='http://via.placeholder.com/100x100?text=foo' />
    </FacebookShareButton>
  </div>
);

render(<App />, document.getElementById('root'));

Or if you want to customize the link preview of facebook, use open graph. Read here for further details: https://developers.facebook.com/docs/sharing/webmasters#markup & http://ogp.me/

yantakus commented 6 years ago

Why not add this to the readme?