New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@groupby/elements-product

Package Overview
Dependencies
Maintainers
12
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@groupby/elements-product

```html <gbe-product product="{}"></gbe-product> ```

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
12
Weekly downloads
 
Created
Source

GroupBy Elements Product Component

<gbe-product product="{}"></gbe-product>

The product component will display information about a given product.

Functionality

The component takes one product attribute (refer to the ProductModel instance for the data format).

{
  "title": "Product Name",
  "price": 3.55,
  "productUrl": "http://example.com/img.jpg",
  "imageSrc": "http://example.com/img.jpg",
  "imageAlt": "Alternative image text"
}

Customizations

Optionally the product can use variants to display different information based on what variant is selected (refer to the ProductVariantsModel instance for the data format).

{
  "variants": {
    "type": "text" // default, can be either "text", "image", "color"
    "items": [
      {
        "text": "Variant Label",
        "product": {
          // Data that will be overwritten in the product component
        }
      }
    ]
  }
}

Any properties that are not identified in the ProductModel, will be rendered as additional <span> tags in the component.

Testing

The test suite for this component is contained in test directory. To run the tests, navigate to this folder and use one of the following commands based on the desired testing flow:

  • To run the tests once:
yarn test
  • To run the tests and watch the src and test directories for changes:
yarn tdd

FAQs

Package last updated on 29 Nov 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc