React Facebook

Like

Renders a Facebook Like button via the XFBML social plugin.

The Like component renders a Facebook Like button. It uses the XFBML parser under the hood to produce the official Facebook widget.

Try it live

Experiment with layouts, sizes, and actions in the Playground.

EU/EEA Limitations

The Like button plugin is affected by Facebook's privacy changes in European regions. Users in EU/EEA countries and the United Kingdom must be logged into Facebook and have consented to "App and Website Cookies" in their Facebook settings. If these requirements are not met, the Like button will not be visible. This is a Facebook platform limitation. Consider alternative engagement methods for European users.

Import

import { Like } from 'react-facebook';

Props

PropTypeDefaultDescription
hrefstringCurrent page URLThe URL to like.
layout'standard' | 'button_count' | 'button' | 'box_count'undefinedLayout style for the button.
showFacesbooleanfalseShow profile photos of friends who liked the page.
colorSchemestringundefinedColor scheme (e.g. 'light' or 'dark').
actionstringundefinedThe verb to display (e.g. 'like' or 'recommend').
sharebooleanfalseInclude a share button beside the Like button.
widthnumber | stringundefinedWidth of the plugin in pixels.
sizestringundefinedButton size (e.g. 'small' or 'large').
kidDirectedSitebooleanfalseIf your site is directed at children under 13 set this to true.
referralstringundefinedA label for tracking referrals (maps to data-ref).
lazybooleanfalseLazy-load the plugin.
classNamestring''Additional CSS class names appended to the container.

Usage

Basic

<Like href="https://www.facebook.com/YourPage" />

With Layout and Faces

<Like href="https://www.facebook.com/YourPage" layout="standard" showFaces share width={450} />

Dark Color Scheme

<Like href="https://www.facebook.com/YourPage" colorScheme="dark" layout="button_count" size="large" />

Box Count Layout

<Like href="https://example.com/article" layout="box_count" action="recommend" />

On this page