0.10.2 • Published 1 year 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-compareor
yarn add @bolttech/frontend-foundations @bolttech/molecules-compareProps
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
1 year ago
0.10.2
1 year ago
0.10.0
1 year ago
0.9.0
1 year ago
0.8.0
1 year ago
0.7.0
1 year ago
0.6.1
1 year ago
0.6.0
2 years ago
0.5.4
2 years 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