When could you actually retire? Drop a single script tag into your site, then use <retirement-calc-age> as a custom HTML element anywhere on the page.
Pick colors that match your site, then copy the CSS snippet at the bottom.
retirement-calc-age {
--rc-accent: #4f8ec9;
--rc-bg: #ffffff;
--rc-surf: #f7f9fc;
--rc-text: #1a1f2e;
}
Drop this into your HTML:
<script src="https://app.retirementscenario.com/embed/v1/age.js"></script>
<retirement-calc-age></retirement-calc-age>
Or pre-seed values relevant to your audience:
<retirement-calc-age
plan-type="household"
current-age="48"
current-savings="1200000"
contrib-annual="35000"
monthly-goal="7500"
ss-amount="2700"
return-pct="7.0">
</retirement-calc-age>
| Attribute | Default | Range |
|---|---|---|
current-age | 50 | 30 – 70 |
current-savings | 1000000 | 0 – 5,000,000 |
contrib-annual | 25000 | 0 – 50,000 (incl. employer match) |
monthly-goal | 5000 | 1,000 – 20,000 (retirement spending) |
ss-amount | 2500 | 0 – 5,000 (monthly at FRA) |
return-pct | 7.0 | 4.0 – 10.0 (nominal annual %, engine handles inflation) |
plan-type | single | single or household |
refsrc | (none) | partner attribution tag |
Override CSS custom properties on the host:
retirement-calc-age {
--rc-accent: #ff6b35; /* primary color */
--rc-bg: #ffffff; /* card background */
--rc-surf: #f7f9fc; /* sub-surface (result area) */
--rc-text: #1a1f2e;
--rc-muted: #6a7280;
--rc-border: rgba(20,30,50,0.10);
--rc-radius: 12px;
}
The element emits two custom events you can listen to:
document.querySelector('retirement-calc-age')
.addEventListener('rc-calculated', (e) => {
console.log('Earliest age:', e.detail.earliestAge);
});
document.querySelector('retirement-calc-age')
.addEventListener('rc-cta-clicked', (e) => {
console.log('User clicked CTA to:', e.detail.url);
});