Social Share
The SocialShare component is a sharing widget for Facebook, Twitter, LinkedIn, and email. It provides buttons to share a URL with a description on these social platforms.
Usage
import { SocialShare } from 'components/lib';
function MyComponent({ ...props }){
const url = 'https://example.com';
const description = 'Check out this amazing website!';
return (
<div>
<SocialShare url={ url } description={ description } />
</div>
);
}
Props
| Prop | Description | value | |
|---|---|---|---|
| className | custom styles | optional | SCSS or Tailwind style |
| description | text for the social media post | required | string |
| url | url of the page to share | required | string |
Notes
- The
SocialSharecomponent uses theButtoncomponent from'components/lib'to create sharing buttons. - The
networksobject defines the sharing URLs for Facebook, Twitter, LinkedIn, and email. - The
classNameprop allows for custom styling to be applied. - The
descriptionprop provides the text for the social media post. - The
urlprop specifies the URL of the page to share.
Social Sign-In
Gravity Web includes buttons for Facebook and Twitter. Configure their server-side providers before enabling the buttons.
Usage
import { SocialSignin } from 'components/lib';
function MyComponent({ ...props }){
const networks = ['facebook', 'twitter'];
return (
<div>
<SocialSignin network={ networks } />
</div>
);
}
Props
| Prop | Description | Required | Value |
|---|---|---|---|
| className | custom style | optional | SCSS or Tailwind |
| invite | user is being invited as a child | optional | boolean |
| network | array of social network names | required | array |
| signup | user is signing up a new account | optional | boolean |
Notes
- The
SocialSignincomponent uses theButton,cn,Grid, anduseTranslationcomponents from'components/lib'. - The
networkprop specifies the list of social networks for sign-in/sign-up, each represented as a string. - The
inviteandsignupprops control whether the user is invited as a child or signing up, respectively. - The
classNameprop allows for custom styling to be applied. - The
loadingstate is managed for each network button to indicate loading status. - The
serverURLis constructed based on the current environment settings.