npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-social-media-bar

v0.0.4

Published

A React component creating external links to social media profiles using Font Awesome icons

Downloads

17

Readme

React Social Media Bar

react-social-media-bar is a React component to create external social media links

Features

  • uses Font Awesome brand icons
  • customizable overall and within each icon (as per colors, sizes, opacities, etc.)

Version

  • this is the first version of react-social-media-bar

Table of Contents

Installation

  1. Install React Social Media Bar as a dependency
# NPM
npm install react-social-media-bar --save

# Yarn
yarn add react-social-media-bar
  1. Import the react-social-media-bar module
// ES6
import SocialMediaBar from 'react-social-media-bar';
  1. Import Font Awesome into your project. I recommend using the CDN. See here for directions.

Examples

Live demo: [to be implemented] To build the examples locally, clone this repo. Then run:

npm install
cd examples
npm install
npm start

Then open localhost:3000 in a browser window.

Props

Properties are passed into the SocialMediaBar as follows. These are the default values for each property. Note that not all properties are required.

<SocialMediaBar
  icons={[]}
  bgColor="rgba(0, 0, 0, 0)"
  iconColor="#000"
  iconOpacity={1}
  iconSize="1em"
  hoverColor="#000"
  hoverOpacity={1}
  margin={{top: '5px', right: '5px', bottom: '5px', left: '5px'}}
  padding={{top: '0px', right: '0px', bottom: '0px', left: '0px'}}
  sameTab={false}
  vertical={false}
/>

| Property | Type | Required | Default | Description |:---|:---|:---|:---|:---| | icons | Array | yes | [] | The icons that will be rendered. See below for format. | | bgColor | String | no | rgba(0, 0, 0, 0) | The background color of the component. | | iconColor | String | no | #000 | The color of each icon in the icons array when hovered over. | | iconOpacity | Integer | no | 1 | The opacity of each icon in the icons array when hovered over. | | iconSize | String | no | 1em | The size of each icon in the icons array. | | hoverColor | String | no | #000 | The color of an icon in the icons array when hovered over. | | hoverOpacity | Integer | no | 1 | The opacity of an icon in the icons array when hovered over. | | margin | Object | no | {top: '5px', right: '5px', bottom: '5px', left: '5px'} | The margin on each icon in the icons array. | | padding | Object | no | {top: '0px', right: '0px', bottom: '0px', left: '0px'} | The padding on each icon in the icons array. | | sameTab | Boolean | no | false | If true, clicking on an icon will open its corresponding media link in the same tab. If false (by default), media links will open in a new tab. | | vertical | Boolean | no | false | If true, the icons will be rendered vertically in a column. If false (by default), the icons will be rendered horizontally in a row. |

Icons Property

The icons property is an Array of Objects in which each Object represents an icon to be included in this component. Each icon Object has the following key-value pairs. Note that if a key is not specified in this Object, the key inherits the value given to its corresponding property from the table above. If the property was not defined, the key is given the default value listed in the table above. For more clarification, please see the Examples.

| Key | Value Type | Required | Description | |:---|:---|:---|:---| | media | String | yes | The Font Awesome icon name of the social media (i.e. 'github', 'facebook-official', 'youtube', ...) | | link | String | yes | The URL to which this icon will link | | iconColor | String | no | The color of this icon when hovered over. | | iconOpacity | Integer | no | The opacity of this icon when hovered over. | | iconSize | String | no | The size of this icon. | | hoverColor | String | no | The color of this icon when hovered over. | | hoverOpacity | Integer | no | The opacity of this icon when hovered over. | | margin | Object | no | The margin on this icon. | | padding | Object | no | The padding on this icon. | | sameTab | Boolean | no | If true, clicking on this icon will open its link URL in the same tab. If false the link URL will open in a new tab. |

Credits

  • Dave Gandy, the awesome creator of Font Awesome
  • Alan Smith and Noel Broda, who wrote articles on Medium to guide me through creating and publishing this React Component