React Facebook

Share

Renders a Facebook Share button via the XFBML social plugin.

The Share component renders the official Facebook Share button widget. It produces an XFBML-parsed button that opens the Facebook Share dialog when clicked.

Try it live

Experiment with layouts and sizes in the Playground.

If you need a custom-styled share button (rather than the Facebook widget), see ShareButton.

Import

import { Share } from 'react-facebook';

Props

PropTypeDefaultDescription
hrefstringCurrent page URLThe URL to share.
layout'box_count' | 'button_count' | 'button' | 'icon_link''icon_link'Layout style for the share button.
size'small' | 'large''small'Button size.
lazybooleanfalseLazy-load the plugin.
classNamestring''Additional CSS class names appended to the container.

Usage

Basic

<Share href="https://example.com/article" />

Large Button with Count

<Share href="https://example.com/article" layout="button_count" size="large" />

Box Count Layout

<Share href="https://example.com/article" layout="box_count" />

On this page