✦ Embeddable · v1

An embeddable retirement calculator that answers one question.

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.

Live demos

Default (single, defaults)

Themed (orange accent, household, pre-seeded)

Preview your theme

Pick colors that match your site, then copy the CSS snippet at the bottom.

Theme colors

Big number, slider thumb, CTA button
#4f8ec9
Outer surface of the calc
#ffffff
Result area + toggle background
#f7f9fc
Title, slider values, result subline
#1a1f2e
retirement-calc-age {
  --rc-accent: #4f8ec9;
  --rc-bg: #ffffff;
  --rc-surf: #f7f9fc;
  --rc-text: #1a1f2e;
}

Integration code

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>

Attributes

AttributeDefaultRange
current-age5030 – 70
current-savings10000000 – 5,000,000
contrib-annual250000 – 50,000 (incl. employer match)
monthly-goal50001,000 – 20,000 (retirement spending)
ss-amount25000 – 5,000 (monthly at FRA)
return-pct7.04.0 – 10.0 (nominal annual %, engine handles inflation)
plan-typesinglesingle or household
refsrc(none)partner attribution tag

Theming

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;
}

Events

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);
  });