✦ Embeddable · v1

An embeddable retirement calculator that answers one question.

What could break my retirement plan? Drop a single script tag into your site, then use <retirement-calc-stress> as a custom HTML element anywhere on the page. Runs the user's plan through 4 canonical stress scenarios (crash at retirement, longevity, SS benefits cut 25%, Lost Decade) and ranks them by impact. First risk-ranking embed in the family — the headline names the biggest risk to THIS user's plan, not a generic one.

Complementary to <retirement-calc-resilience> (single sequence-risk scenario, deeper) — Stress Portfolio gives the multi-scenario ranked view, Resilience gives the single-scenario verdict.

Live demos

Default (single 55yo, $800K, $5K goal, $2.2K SS)

Themed (household, $1.5M, retiring at 62)

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

<retirement-calc-stress></retirement-calc-stress>

Or pre-seed values relevant to your audience:

<retirement-calc-stress
  plan-type="household"
  current-age="60"
  retirement-age="65"
  nest-egg="1000000"
  monthly-goal="6000"
  ss-fra-benefit="2500"
  life-expectancy="90"
  expected-return="6">
</retirement-calc-stress>

Attributes

AttributeDefaultRange
plan-typesinglesingle or household
current-age5530 – 80
retirement-age6545 – 80
nest-egg800000100,000 – 10,000,000 (portfolio at retirement)
monthly-goal50001,000 – 30,000 (monthly spending target)
ss-fra-benefit22000 – 5,000 (SS at full retirement age — typical SSA statement number)
life-expectancy9070 – 105
expected-return62 – 12 (% expected pre-retirement nominal return)
refsrc(none)partner attribution tag

Honest scope: 4 canonical stresses chosen to span distinct risk dimensions (market timing, longevity, policy, prolonged returns). Doesn't include healthcare shock (requires fiddly baseline setup) or pure high inflation (engine's all-pass-through model makes it neutral for SS-heavy plans). SS-cut stress assumes 25% benefit reduction (CBO's no-action projection for the trust fund around 2033). Single retirement horizon; full app handles staggered/multi-event plans. 5× MC (~3-5 sec total compute).

Theming

Override CSS custom properties on the host:

retirement-calc-stress {
  --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-stress')
  .addEventListener('rc-calculated', (e) => {
    console.log('Baseline success rate:', e.detail.baselineSR);  // %
    console.log('Biggest risk:', e.detail.biggestRisk);          // label string
    console.log('All stresses ranked:', e.detail.stresses);      // array sorted by impact (worst first)
  });

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