@helpusersvote/react

React components to help your users vote

Stats

StarsIssuesVersionUpdatedCreatedSize
@helpusersvote/react
201.2.43 years ago4 years agoMinified + gzip package size for @helpusersvote/react in KB

Readme

@helpusersvote/react

React components to help your users vote

Installation

First, add these components to your codebase:

npm install --save @helpusersvote/react

Usage

In your app, import components from the @helpusersvote/react module to add them to a page:

import { Banner } from '@helpusersvote/react'
import Home from '../components/home'

const HomePage = props => (
  <Home>
    <Banner ctaColor="red" />
  </Home>
)

export default HomePage

If you want to add tracking to your call-to-action, add your namespace and campaign:

import { Banner } from '@helpusersvote/react'
import Home from '../components/home'

const HomePage = props => (
  <Home>
    <Banner namespace="example.com" campaign="home-page" />
  </Home>
)

// Which is the same as doing
const HomePage = props => (
  <Home>
    <Banner ctaHref="https://go.helpusersvote.com/v1/example.com/home-page" />
  </Home>
)

export default HomePage

If you want to only show the banner on special days, use the ShouldShowCTA component:

import { ShouldShowCTA, Banner } from '@helpusersvote/react'
import Home from '../components/home'

// namespaceId = partner id for your team
// id = lookup key for call-to-action, e.g. where it's rendered
const HomePage = props => (
  <Home>
    <ShouldShowCTA>
      <Banner namespace="example.com" campaign="home-page">
    </ShouldShowCTA>
  </Home>
)

export default HomePage

License

All modules are open-sourced under the MIT License

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.