Demonstrates integrating the widget via a built script tag
Partners can install the widget and build a self-contained script file:
# From git URL
npm install github:username/intestacy-calculator
# Or from a local tarball
npm pack # creates intestacy-calculator-1.0.0.tgz
npm install ./intestacy-calculator-1.0.0.tgz
npm run build
# Output: dist/intestacy-widget.min.js
<!-- Add this where you want the calculator -->
<div id="intestacy-calculator"></div>
<!-- Include the built script -->
<script src="intestacy-widget.min.js"></script>
<script>
new IntestacyWidget({
container: '#intestacy-calculator',
theme: 'none',
contactInfo: 'Contact us to discuss creating a Will.'
});
</script>
Setting theme: 'none' lets your site's CSS control the widget's appearance.
Use theme: 'light' or theme: 'dark' for the built-in themes.