0.0.6 • Published 4 years ago

react-pride-banner v0.0.6

Weekly downloads
5
License
MIT
Repository
github
Last release
4 years ago

react-pride-banner 🏳️‍🌈

npm

A simple pride flag component for React apps

Installation

To install, run the following command:

yarn add react-pride-banner

or, if you're using npm, run:

npm install --save react-pride-banner

Note that this package has three peerDependencies that also need to be installed in your project for it to work:

  • react: v^16.8.0
  • react-dom: v^16.8.0
  • styled-components: v^5.0.0

Getting started

To use this library in your React application, you can pull it in as shown in the following example:

import React from "react";
import PrideBanner from "react-pride-banner";

const App = () => {
  return (
    <main>
      <PrideBanner />

      <div>my main content here</div>
    </main>
  );
};

export default App;

Note that the component should be rendered as close to the root of your application as possible to ensure that it is rendered correctly at the top of the browser.

Properties

Below are the props that are accepted by the PrideBanner component.

proptypedefaultValuerequireddescription
bannerColorsobject; see below*-Nocolors to use for the banner
childrenoneOfType( node, nodeArray )-Nochildren to be rendered inside the banner; if omitted, then the component will NOT expand on hover
classNamestring-NoclassName to be used in the DOM
idstring-Noid to be used in the DOM
positiononeOf( absolute, fixed )fixedNoposition for the banner on the page

bannerColors

The bannerColors object must take the shape in the following example:

const bannerColors = {
  red: "#FF0000",
  orange: "#FFA500",
  yellow: "#FFFF00",
  green: "#008000",
  blue: "#0000FF",
  violet: "#EE82EE",
};