Giter VIP home page Giter VIP logo

react-pride-banner's Introduction

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.

prop type defaultValue required description
bannerColors object; see below* - No colors to use for the banner
children oneOfType( node, nodeArray ) - No children to be rendered inside the banner; if omitted, then the component will NOT expand on hover
className string - No className to be used in the DOM
id string - No id to be used in the DOM
position oneOf( absolute, fixed ) fixed No position 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",
};

Example usages

  • TBD

react-pride-banner's People

Contributors

dependabot[bot] avatar haldunanil avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.