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

@buyloop/pricing-tiers

v0.3.7

Published

The `PricingTiers` component is a React component for rendering a pricing list using Buyloop's public API. It allows you to display pricing information for different tiers, and you can customize its behavior with various properties.

Downloads

2

Readme

Buyloop PricingTiers Component Documentation

The PricingTiers component is a React component for rendering a pricing list using Buyloop's public API. It allows you to display pricing information for different tiers, and you can customize its behavior with various properties.

Installation

You can install the PricingTiers component via npm:

npm install @buyloop/pricing-tiers

Usage

Import the PricingTiers component into your React application and use it as follows:

import PricingTiers from "@buyloop/pricing-tiers";

function MyApp() {
    return (
        <PricingTiers
            buyloop-api-key={"your_buyloop_public_api_key"}
            pricingTemplateId={"your_pricing_template_id"}
            language={language}
            callbackFunction={(pricingTier, selectedPrice) => 
                console.log(`Price tier selected: ${pricingTier.displayName}, price: ${selectedPrice.value}${selectedPrice.currency}`)}
            showUnavailableFeatures={true} // Optional, set to true to display unavailable features with strikethrough
        />
    );
}

Make sure to replace "your_buyloop_public_api_key" and "your_pricing_template_id" with your actual API key and pricing template ID.

Properties

The PricingTiers component accepts the following properties:

  • buyloop-api-key (string, required): Your Buyloop public API key, which can be generated in the "Developers" section of the Buyloop admin UI.
  • pricingTemplateId (string, required): The ID of the pricing template to render.
  • language (string, required): The language to render in ISO 639-1 code format
  • callbackFunction (function, required): A callback function that will be called once a pricing tier is selected. It receives the selected PricingTier as an input argument. You can customize the behavior in this function.
  • showUnavailableFeatures (boolean, optional): If set to true, unavailable features on tiers will be rendered with strikethrough. If set to false, they will not be displayed. Default is false.

Styling the Component

The PricingTiers component uses standard Material-UI components and can be styled in various ways to match your application's design. You can apply styles globally through your application's theme, create a dedicated theme for the PricingTiers component, or directly use CSS to customize its appearance.

Global Theme Styling

To style the PricingTiers component using your application's global theme, you can define the styling options in your theme configuration. Here's an example of how to customize the component using the global theme:

const theme = createTheme({
    palette: {
        mode: 'light',
        primary: {
            main: '#8DDFCB',
            contrastText: '#82A0D8',
        },
        secondary: {
            main: '#ECEE81',
        },
        text: {
            primary: '#414141',
            secondary: '#555555',
            disabled: '#E2E2E2',
        },
        background: {
            paper: '#EDB7ED',
        },
        error: {
            main: '#ac350c',
        },
    },
    typography: {
        fontFamily: 'courier',
        h1: {
            fontSize: '5rem',
            fontWeight: 400,
        },
        h2: {
            fontSize: '4rem',
            fontWeight: 600,
            color: '#8DDFCB'
        },
        button: {
            textTransform: 'uppercase'
        },
    },
    components: {
        MuiCard: {
            styleOverrides: {
                root: {
                    border: "2px solid",
                    borderColor: "#82A0D8",
                }
            }
        },
        MuiButton: {
            styleOverrides: {
                root: {
                    border: "2px solid",
                    borderColor: "#82A0D8",
                }
            }
        },
    }
});