Testing both Banner and Card layouts with all sub-components
Environment:
BFF URL:
Full vertical layout with all features. Best for dedicated pricing pages or when you want to give the widget prominent placement. Includes logo, location inputs, pricing display, and value proposition.
Updates both the default card above and the fluid card below.
<cd-price-check-widget-card
bff-url="https://your-bff-url.com"
token="your-auth-token"
pickup-postal-code="85044"
vin="1HGBH41JXMN109186"
year="2021"
make="Honda"
model="Accord"
is-operable="true"
></cd-price-check-widget-card> Opt in with the fluid attribute to let the card grow to fit its parent container
while keeping its original proportions โ every element scales together, so nothing reflows or
distorts. The card always stays fully visible: it scales to fit within the box on whichever
dimension is more constraining, with any leftover room on the other dimension showing as blank
space rather than a scrollbar. It also never renders smaller than the fixed-size card above โ
drag the bottom-right corner of the dashed box below and notice it won't let you shrink it past
that floor.
<cd-price-check-widget-card
bff-url="https://your-bff-url.com"
token="your-auth-token"
pickup-postal-code="85044"
vin="1HGBH41JXMN109186"
year="2021"
make="Honda"
model="Accord"
is-operable="true"
fluid="true"
></cd-price-check-widget-card> Compact horizontal layout optimized for space-constrained areas like headers, sidebars, or embedded sections. Shows essential information in a streamlined format.
<cd-price-check-widget-banner
bff-url="https://your-bff-url.com"
token="your-auth-token"
pickup-postal-code="10001"
dropoff-postal-code="90210"
vin="JH4KA7561MC010714"
year="2020"
make="Acura"
model="NSX"
is-operable="true"
></cd-price-check-widget-banner> <cd-price-check-widget-banner
bff-url="https://your-bff-url.com"
token="your-auth-token"
pickup-postal-code="10001"
dropoff-postal-code="90210"
vin="JH4KA7561MC010714"
year="2020"
make="Acura"
model="NSX"
is-operable="true"
vertical-view="true"
></cd-price-check-widget-banner> All widget events are logged here in real-time. Watch for lifecycle events, user interactions, and API calls.
const widget = document.querySelector('cd-price-check-widget-card'); // or 'cd-price-check-widget-banner'
widget.addEventListener('priceLoaded', (event) => {
const { minPrice, maxPrice, distance } = event.detail;
console.log(`Price: $${minPrice} - $${maxPrice} for ${distance} miles`);
});
widget.addEventListener('locationChanged', (event) => {
const { pickupPostalCode, dropoffPostalCode } = event.detail;
console.log(`Location changed: ${pickupPostalCode} โ ${dropoffPostalCode}`);
});