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

@backbone.one/bb1-web-components

Package Overview
Dependencies
Maintainers
0
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@backbone.one/bb1-web-components

#### Installation

  • 0.0.2
  • latest
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

EnergyCalculator Web Component Documentation

Installation

To install the BB1EnergyCalculator web component, you need to use npm. Run the following command in your project directory:

npm i @backbone.one/bb1-web-components
Usage

After installing the package, you can use the bb1-energy-calculator web component in your project. Follow the steps below to integrate it into your application.

  1. Import the Component

    Import the @backbone-one/web-components web component in your JavaScript or TypeScript file:

    import '@backbone-one/web-components';
    
  2. Add the Component to Your HTML

    You can now use the bb1-energy-calculator component in your HTML. Here is an example of how to include it in your HTML file:

     <!doctype html>
     <html lang="en">
       <head>
         <meta charset="UTF-8" />
         <meta name="viewport" content="width=device-width, initial-scale=1.0" />
         <title>Your Page</title>
       </head>
       <body>
         <bb1-energy-calculator
           offer-service-api-key="your-api-key"
           calculator-link="https://your-domain.com/#/energy-calculator"
           translations='{"key": "value"}'
           onsubmit="handleSubmit"
           onerror="handleError"
         ></bb1-energy-calculator>
       </body>
     </html>
    
  3. Attributes

    The bb1-energy-calculator component accepts the following attributes:

    • offer-service-api-key (string): The API key for the offer service.
    • calculator-link (string?): The URL to the tariff calculator that will be opened when the form is submitted. If not provided, no calculator will be opened.
    • translations (object): A JSON object containing translation keys and values.
    • onsubmit (function(event: Event): void?): A JavaScript function to handle the form submission.
    • onerror (function(error: Error): void?): A JavaScript function to handle errors.
  4. Translations

    The translations attribute accepts a JSON object with the following keys:

    • title (string): The title of the calculator.
    • subTitle (string): The subtitle of the calculator.
    • householdSize (string): The label for the household size input.
    • annualConsumption (string): The label for the annual consumption input.
    • zip (string): The label for the ZIP code input.
    • zipPlaceholder (string): The placeholder for the ZIP code input.
    • gridOperator (string): The label for the grid operator input.
    • gridOperatorPlaceholder (string): The placeholder for the grid operator input.
    • gridOperatorInfo (string): The info text for the grid operator input.
    • submit (string): The text for the submit button.

FAQs

Package last updated on 13 Dec 2024

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