0.10.2 • Published 10 months ago
@bolttech/molecules-compare v0.10.2
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:
Prop | Type | Description |
---|---|---|
title | string | The title for the comparison section. |
productsSelected | array | An array of selected products to be compared. |
btnCompareTitle | string | The title for the compare button. |
btnCloseTitle | string | The title for the close button. |
btnCloseModalTitle | string | The title for the close button in the modal. |
onClose | function | Callback to be called when the close button is clicked. |
onRemove | function | Callback 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.10.1
10 months ago
0.10.2
10 months ago
0.10.0
10 months ago
0.9.0
10 months ago
0.8.0
10 months ago
0.7.0
11 months ago
0.6.1
1 year ago
0.6.0
1 year ago
0.5.4
1 year ago
0.5.3
2 years ago
0.5.2
2 years ago
0.5.1
2 years ago
0.5.0
2 years ago
0.4.1
2 years ago
0.4.0
2 years ago
0.3.4
2 years ago
0.3.3
2 years ago
0.3.1
2 years ago
0.3.0
2 years ago
0.2.1
2 years ago
0.2.0
2 years ago
0.1.0
2 years ago