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

flex-banner

v2.2.2

Published

Fully responsive react banner for websites

Downloads

41

Readme

NPM JavaScript Style Guide Build Status

Install

npm install --save flex-banner

or

yarn add flex-banner

Usage

import * as React from "react";

import FlexBanner from "flex-banner";

class Example extends React.Component {
  render() {
    return (
      <FlexBanner
        title="Fully responsive react banner for websites"
        ctaLink="https://github.com/IsAmrish/flex-banner"
        ctaTitle="Learn More"
        isCenter={true}
      />
    );
  }
}

Usage with Optional Properties

This example includes optional property in the component:

ctaTitle - Title of Call To Action (CTA).

isCenter - To make banner title and link center aligned.

crossIconSize - To define, font size of cross Icons.

animationTime - To define, sliding { SlideDown and SlideUp } time of banner.

delayToShowBanner - Delay in showing up banner.

daysToLive - No of days cookie will live before banner is shown up.

wrapperStyle - style object for styling of the wrapper

mainStyleTitle - style object for styling of the title of banner. If ctaTitle property is not defined, then this will defined the styling of link.

mainStyleLink - style object for styling of the CTA of banner.

crossStyle - style object for styling of the crossIcon. The font size of cross icon can only be defined by crossIconSize property.

hidePermanentlyOnDate - To hide banner permanently on a specific date / datetime

Properties

| Property | Type | Required | Default value | Description | | ----------------- | ------- | -------- | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | title | string | yes | | the title of the banner | | ctaLink | string | yes | | url for the call to action | | ctaTitle | string | no | | The title for call to action. It is not required if you want to use title as title of call to action | | isCenter | boolean | no | true | Make center aligned the banner with value true otherwise left aligned using value false | | crossIconSize | number | no | 22 | size of crossIcon in px. Set its value to 0 if you don't want to add crossIcon. | | animationTime | number | no | 1 | animationTime is in seconds. It's sliding time for banner. For no animation, set value to 0. | | delayToShowBanner | number | no | 2 | delayToShowBanner is in seconds. It's the time a user has to keep the page open before the banner is shown. For no delay, set value to 0 | | daysToLive | number | no | 0 | A property specifying the number of days the cookie will live before the banner is shown again to a user. The default is 0, it means that banner will show up every time user refresh the page or hit the page url. | | wrapperStyle | object | no | | style object for styling of the wrapper | | mainStyleTitle | object | no | | style object for styling of title | | mainStyleLink | object | no | | style object for styling of Call To Action link | | crossStyle | object | no | | style object for styling cross Icon - such as color etc. Note - font size property will be set only by crossIconSize property. |

| hidePermanentlyOnDate | Date | no | | To hide banner permanently on a specific date / datetime property. |

Example with CTA title

import * as React from "react";

import FlexBanner from "flex-banner";

class Example extends React.Component {
  render() {
    return (
      <FlexBanner
        title="Fully responsive react banner for websites"
        ctaLink="https://github.com/IsAmrish/flex-banner"
        ctaTitle="Learn More"
        isCenter={false}
        crossIconSize={24}
        animationTime={1.5}
        delayToShowBanner={0}
        daysToLive={5}
        wrapperStyle={{ backgroundColor: "lightblue" }}
        mainStyleTitle={{ color: "black" }}
        mainStyleLink={{ color: "red" }}
        crossStyle={{ color: "red" }}
      />
    );
  }
}

Results

Example without CTA title

import * as React from "react";

import FlexBanner from "flex-banner";

class Example extends React.Component {
  render() {
    return (
      <FlexBanner
        title="Fully responsive react banner for websites"
        ctaLink="https://github.com/IsAmrish/flex-banner"
        isCenter={false}
        crossIconSize={24}
        animationTime={1.5}
        delayToShowBanner={0}
        daysToLive={5}
        wrapperStyle={{ backgroundColor: "lightblue" }}
        mainStyleTitle={{ color: "green" }}
        mainStyleLink={{ color: "blue" }} // this will not work
        crossStyle={{ color: "red" }}
      />
    );
  }
}

Results


Responsive View of FlexBanner

The banner will be shown top regardless of screen.

License

MIT © isamrish