Cuvrd Low Code Widgets

Embedded Subscription Quote Panel Widget


Current Version


1.0.1, Updated April 11, 2024

1.0.1: Fixed conflicts in widget-rendering CSS file.

Overview


The Cuvrd subscription quote panel widget is a lightweight, low-code embeddable widget that gives your customers the ability to get a subscription VSC quote directly on your website.

Your customer enters their vehicle and gets an instant quote — right on your website.

If they choose to purchase, only then are they directed to the checkout process on your co-branded sales website.

Our goal was to make it as simple as possible for you to add VSC quoting functionality to your website with minimal to zero tech resources required.

Is it difficult to use the widget?


Not at all.

The subscription quote panel widget is a super-easy to deploy.

You simply paste a few lines of code to your website, and you're done.

The quote panel widget can be rendered in any container on any page of your website, allowing your customers to get VSC pricing without leaving your environment.

The widget is highly customizable, allowing you to control the look and feel of the widget to match your website's design.

You can run the widget directly from our servers or download the code and serve it up from your own website.

Can I See an Example?


Of course.

Here's a basic example along with the code used to generate it:

HTML

                <link rel="stylesheet" href="https://widget.cuvrd.com/vsc-quote-panel@1.0/dist/cuvrd-widget/style.css" />
<script type="module" src="https://widget.cuvrd.com/vsc-quote-panel@1.0/dist/cuvrd-widget/cuvrd-widget.es.js"></script>
<script type="module">
 const widget = new CuvrdWidget({
    container: '#widget-example',
    env: 'demo',
	apiKey: 'CV.KbHvHnUrPUs1UcPuep.OFwBG24zLxRudK61Sy',
	whitelabel: 'api-testing-website',
  style: {}
  });
</script>
              

Placement


The quoting widget is designed to work in full-width containers such as hero blocks.

The widget will display in desktop mode with the selectors arranged horizontally when the viewport is 768px wide and above.

For viewports below 768px, the selectors will appear in mobile mode and be arranged vertically.

Please note that the above widths are based on the viewport, not the container. Containers that are less than the full width of the viewport can cause the year and mileage inputs to be clipped at the ends.

Usage


You can download and host the widget on your own servers or use the widget directly from our servers.

Each method has its advantages — self hosting may render the widget quicker, but using our CDN will ensure you have the most recent release.

The widget can be downloaded here. Simply download, and unzip to a folder on your web server.

Reference the downloaded module and the associated base CSS with the following HTML before you call the widget:

<link rel="stylesheet" href="path-to-local-folder/style.css" />
<script type="module" src="path-to-local-folder/cuvrd-widget.es.js"></script>

To use the widget directly from our servers, simply include the following code in your HTML file before you call the widget:

<link rel="stylesheet" href="https://widget.cuvrd.com/vsc-quote-panel@1.0/dist/cuvrd-widget/style.css" />
<script type="module" src="https://widget.cuvrd.com/vsc-quote-panel@1.0/dist/cuvrd-widget/cuvrd-widget.es.js"></script>

Note: The widget can only be called once per page. You cannot render the widget in multiple divs on a single page, even if you call with different variable names assigned to different ids.

Barebones Example


Here's a barebones example of how to use the widget:

                <link rel="stylesheet" href="https://widget.cuvrd.com/vsc-quote-panel@1.0/dist/cuvrd-widget/style.css" />
<script type="module" src="https://widget.cuvrd.com/vsc-quote-panel@1.0/dist/cuvrd-widget/cuvrd-widget.es.js"></script>
<script type="module">
 const widget = new CuvrdWidget({
    container: '#id-of-your-container',
    env: 'prod',
	apiKey: 'your-api-key-here',
	whitelabel: 'your-whitelabel-here',
    style: {}
  });
</script>
              

Fancy CSS Example


Here's an example with some fancy CSS applied:

                <link rel="stylesheet" href="https://widget.cuvrd.com/vsc-quote-panel@1.0/dist/cuvrd-widget/style.css" />
<script type="module" src="https://widget.cuvrd.com/vsc-quote-panel@1.0/dist/cuvrd-widget/cuvrd-widget.es.js"></script>
<script type="module">
 const widget = new CuvrdWidget({
    container: '#id-of-your-container',
    env: 'prod',
	apiKey: 'your-api-key-here',
	whitelabel: 'your-whitelabel-here',
        style: {
          font: 'audiowide',
          bgColor: 'rgba(207, 226, 255, .7)',
          primaryColor: '#0345A0',
          secondaryColor: 'red',
          buttonTextColor: '#ffffff',
        }
  });
</script>
              

See the CSS styling section below for more information on how to customize the look and feel of the widget.

Testing


To quickly test, you can use our testing API credentials, and put it in a full-width container with an ID of cuvrd-widget.

Use this API key:

CV.KbHvHnUrPUs1UcPuep.OFwBG24zLxRudK61Sy

And this white-label id:

api-testing-website

HTML

                <link rel="stylesheet" href="https://widget.cuvrd.com/vsc-quote-panel@1.0/dist/cuvrd-widget/style.css" />
<script type="module" src="https://widget.cuvrd.com/vsc-quote-panel@1.0/dist/cuvrd-widget/cuvrd-widget.es.js"></script>
<script type="module">
 const widget = new CuvrdWidget({
    container: '#widget-example',
    env: 'demo',
	apiKey: 'CV.KbHvHnUrPUs1UcPuep.OFwBG24zLxRudK61Sy',
	whitelabel: 'api-testing-website',
  style: {}
  });
</script>
              

Note: Don't forget to define the environment as 'demo'!

Configuration


Quote Panel Parameters


Use the following parameters in your javascript file when you initialize our widget on your webpage:

Key/Type Required Description
container
string
Yes The ID of the DOM element where the widget will be mounted.
env
enum ('demo' | 'prod')
Yes The environment in which the widget is being used. This helps in loading the appropriate configurations for demo or production environments.
apiKey
string
Yes The API key used for authenticating requests from the widget.
whitelabel
string
Yes The identifier for the whitelabel branding and customization to apply to the widget.
style
object
Yes Object for specifying custom styles to apply to the widget. This includes colors, fonts, and other CSS properties. This property is required, but you can pass an empty object. You can specify many options to adjust styles (see section style configuration)
yearRange
number
No An optional array specifying the range of years to display in the year dropdown. Defaults to last 10 years.

Quote Panel Event Handlers


The following optional event handlers can be configured in your javascript file as well:

Key/Type Required Description
onCreatePlans
(() => void)
No An optional callback function that is called when the process of creating plans is initiated.
onCreatePlansCompleted
((response: any) => void)
No An optional callback function that is called when the creation of plans is completed. It receives the response as an argument.
onSelectPlan
((plan: any) => void)
No An optional callback function that is called when a plan is selected. It receives the selected plan as an argument.
onAddToCart
((plan: any) => void)
No An optional callback function that is called when a plan is added to the cart. It receives the added plan as an argument.
onProceedToCheckout
((plan: any) => void)
No An optional callback function that is called when proceeding to checkout with a selected plan. It receives the selected plan as an argument.
onChangeCar
(() => void)
No An optional callback function that is called when the car selection changes.
onChangePlan
(() => void)
No An optional callback function that is called when the selected plan changes.

Quote Panel CSS/Styling


You can use the following CSS declarations when rendering our widget to better mimic the look and feel of your website, as well as size it appropriately inside its parent object:

Key/Type Required Description
view
string
No Specifies the view mode of the widget. This could dictate the overall layout or specific style presets intended for the widget.
bgColor
string
No Sets the background color of the widget. Accepts any valid CSS color value (e.g., #ffffff, rgba(255, 255, 255, 0.8), red).
font
string
No Defines the font family for the text displayed within the widget. You should provide a valid CSS font-family value (e.g., 'Arial', 'Roboto', sans-serif).
primaryColor
string
No Determines the primary color used throughout the widget, affecting elements such as buttons and links. Accepts any valid CSS color value.
secondaryColor
string
No Defines the secondary color used for the widget's elements, providing a means to complement or contrast with the primary color.
buttonTextColor
string
No Sets the text color for buttons within the widget, ensuring text visibility and alignment with your design scheme.
wrapperStyle
object
No An object containing styles specifically for the widget's wrapper element. This allows for more granular control over the widget's positioning and sizing.

wrapperStyle  Parameters


Key/Type Required Description
maxWidth
string
No Specifies the maximum width of the widget's container. Accepts any valid CSS width value (e.g., 600px, 80%).
width
string
No Sets the width of the widget's container. Like maxWidth, it accepts any valid CSS width value.