✦ Embeddable · v1

An embeddable retirement calculator that answers one question.

Would your plan survive a market downturn? Drop a single script tag into your site, then use <retirement-calc-resilience> as a custom HTML element anywhere on the page.

Sibling of <retirement-calc-age> — same engine, different question.

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-resilience {
  --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/resilience.js"></script>

<retirement-calc-resilience></retirement-calc-resilience>

Or pre-seed values relevant to your audience:

<retirement-calc-resilience
  plan-type="household"
  current-age="48"
  current-savings="1200000"
  contrib-annual="35000"
  retirement-age="62"
  monthly-goal="7500"
  ss-amount="2700"
  return-pct="7.0">
</retirement-calc-resilience>

Attributes

AttributeDefaultRange
current-age5030 – 70
current-savings10000000 – 5,000,000
contrib-annual250000 – 50,000 (incl. employer match)
retirement-age6550 – 75 (planned retirement age)
monthly-goal50001,000 – 20,000 (today's-$ monthly 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-resilience {
  --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-resilience')
  .addEventListener('rc-calculated', (e) => {
    console.log('Stress-tested success rate (0-100):', e.detail.stressSR);
  });

document.querySelector('retirement-calc-resilience')
  .addEventListener('rc-cta-clicked', (e) => {
    console.log('User clicked CTA to:', e.detail.url);
  });