0.6.0 • Published 1 month ago

@bolttech/molecules-compare v0.6.0

Weekly downloads
-
License
-
Repository
-
Last release
1 month ago

Compare Component

A React component for comparing products.

Installation

Use the package manager npm or yarn to install the component.

npm install @bolttech/frontend-foundations @bolttech/molecules-compare

or

yarn add @bolttech/frontend-foundations @bolttech/molecules-compare

Props

The Compare component accepts the following properties:

PropTypeDescription
titlestringThe title for the comparison section.
productsSelectedarrayAn array of selected products to be compared.
btnCompareTitlestringThe title for the compare button.
btnCloseTitlestringThe title for the close button.
btnCloseModalTitlestringThe title for the close button in the modal.
onClosefunctionCallback to be called when the close button is clicked.
onRemovefunctionCallback to be called when a product is removed.

Usage

import React, { useState } from 'react';
import { BolttechThemeProvider, bolttechTheme } from '@bolttech/frontend-foundations';
import Compare from '@bolltech/molecules-compare';

const ExampleComponent = () => {
  const products = [
    // Array of selected products for comparison
  ];

  const handleRemoveProduct = (productId) => {
    // Logic to remove a product from comparison
  };

  const handleClose = () => {
    // Logic to handle the close action
  };

  return (
    <BolttechThemeProvider theme={bolttechTheme}>
      <Compare
        title="Product Comparison"
        productsSelected={products}
        btnCompareTitle="Compare"
        btnCloseTitle="Close"
        btnCloseModalTitle="Close Modal"
        onClose={handleClose}
        onRemove={handleRemoveProduct}
      />
    </BolttechThemeProvider>
  );
};

export default ExampleComponent;

Contributing

Contributions are welcome! For any bug fixes, improvements, or new features, please open an issue or submit a pull request.

Please make sure to follow the code standards and test your changes before submitting.

0.6.0

1 month ago

0.5.4

4 months ago

0.5.3

6 months ago

0.5.2

6 months ago

0.5.1

6 months ago

0.5.0

6 months ago

0.4.1

6 months ago

0.4.0

6 months ago

0.3.4

8 months ago

0.3.3

8 months ago

0.3.1

8 months ago

0.3.0

8 months ago

0.2.1

9 months ago

0.2.0

9 months ago

0.1.0

9 months ago