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

@bolttech/molecules-success-card

v0.22.0

Published

The **SuccessCard** component is a React component that displays a success card with information about a product, its details, and insured information.

Downloads

421

Readme

Success Card Component

The SuccessCard component is a React component that displays a success card with information about a product, its details, and insured information.

Installation

To use the SuccessCard component, you need to install the required dependencies:

npm install @bolttech/frontend-foundations @bolttech/molecules-success-card

or

yarn add @bolttech/frontend-foundations @bolttech/molecules-success-card

Usage

You can use the SuccessCard component by importing it and including it in your JSX. Here's an example:

import React from 'react';
import { SuccessCard } from '@bolttech/molecules-success-card';
import { bolttechTheme, BolttechThemeProvider } from '@bolttech/frontend-foundations'; // Adjust the path to your component

const successCardContent = {
  title: 'Success!',
  productImg: 'path_to_image.png',
  productName: 'Product Name',
  productDescription: 'Product Description',
  contentValue: [
    {
      label: 'Coverage Label 1',
      value: '$1000',
      icon: 'check',
      included: true,
      breakLine: 'normal',
    },
    // Add more content items as needed
  ],
  dividerLabel: 'Insured Information',
  insuredInfo: [
    {
      icon: 'check',
      label: 'Insured Info 1',
    },
    // Add more insured info items as needed
  ],
};

function App() {
  return (
    <BolttechThemeProvider theme={bolttechTheme}>
      {/* SuccessCard component */}
      <SuccessCard {...successCardContent} dataTestId="example" />
    </BolttechThemeProvider>
  );
}

export default App;

Props

The SuccessCard component accepts the following props:

| Prop | Type | Description | | -------------------- | ----------- | ------------------------------------------------------------------ | | dataTestId | string | The data-testid attribute for testing purposes. | | title | string | The title to be displayed at the top of the card. | | productImg | string or | The image URL or JSX element for the product image. | | | ReactNode | | | productName | string | The name of the product. | | productDescription | string | The description of the product. | | contentValue | array | An array of content items to be displayed. | | dividerLabel | string | The label for the divider between content and insured information. | | insuredInfo | array | An array of insured information items. |

Each contentValue and insuredInfo item should have the following structure:

{
  label: 'Label',
  value: 'Value',
  icon: 'icon_name', // Name of the icon from the @bolttech/atoms-icon library
  included: true, // Whether it's included or not (boolean)
  breakLine: 'normal', // Whether to display a line break after this item ('normal' or 'break-all' or undefined)
}

Functionality

The SuccessCard component provides the following functionality:

  • Display: Renders a success card with product information, content items, and insured information.
  • Customizable Content: Allows you to customize the title, product image, product name, product description, content items, and insured information.
  • Icon Display: Displays icons from the @bolttech/atoms-icon library.
  • Divider: Separates content and insured information with a customizable divider label.

Contribution

Contributions to the SuccessCard component are welcomed. If you encounter issues or have suggestions for improvements, feel free to open an issue or submit a pull request on the component's Bitbucket repository.