1import{r as t,j as e,L as h}from"./index-j7I9Tmll.js";import{a as R,C as S,F as a,T as C,f as r,r as w}from"./ui-BrtddqY1.js";/* empty css */function I(){const[l,g]=t.useState("30"),[i,f]=t.useState("60"),[o,d]=t.useState("85"),[n,y]=t.useState("50000"),[u,j]=t.useState("6"),[c,b]=t.useState("12"),[m,v]=t.useState("7"),[x,N]=t.useState("500000"),{result:s,error:p}=t.useMemo(()=>R(()=>w({age:Number(l),retireAge:Number(i),lifeExpectancy:Number(o),monthlyExpense:Number(n),inflationPct:Number(u),preReturnPct:Number(c),postReturnPct:Number(m),savings:Number(x)})),[l,i,o,n,u,c,m,x]);return e.jsxs(S,{slug:"retirement-calculator",children:[e.jsxs("div",{className:"calc-layout",children:[e.jsxs("section",{className:"calc-inputs","aria-label":"Retirement details",children:[e.jsx(a,{label:"Your age now",suffix:"years",value:l,onChange:g,min:18,max:70}),e.jsx(a,{label:"Retirement age",suffix:"years",value:i,onChange:f,min:40,max:75}),e.jsx(a,{label:"Plan until age",suffix:"years",value:o,onChange:d,min:60,max:100}),e.jsx(a,{label:"Monthly expenses today",prefix:"â¹",value:n,onChange:y,min:5e3,max:1e6,step:1e3}),e.jsx(a,{label:"Inflation",suffix:"% p.a.",value:u,onChange:j,min:2,max:12,step:.5}),e.jsx(a,{label:"Return before retirement",suffix:"% p.a.",value:c,onChange:b,min:4,max:15,step:.5}),e.jsx(a,{label:"Return after retirement",suffix:"% p.a.",value:m,onChange:v,min:3,max:12,step:.5}),e.jsx(a,{label:"Savings already set aside",prefix:"â¹",value:x,onChange:N,min:0,max:5e7,step:1e4,slider:!1})]}),e.jsx("section",{className:"calc-results","aria-live":"polite",children:p?e.jsx("p",{className:"calc-error",children:p}):e.jsxs(e.Fragment,{children:[e.jsx(C,{items:[["Monthly SIP needed",s.monthlySip,!0],["Corpus needed at retirement",s.corpusNeeded],["Monthly expenses at retirement",s.expenseAtRetirement]]}),e.jsxs("p",{className:"calc-note",children:["In ",s.yearsToRetire," years, today's ",r(Number(n))," a month will cost about ",r(s.expenseAtRetirement)," a month. Your current savings could grow to ",r(s.savingsAtRetirement),", leaving ",r(s.gap)," to build."]}),s.gap===0&&e.jsx("p",{className:"calc-note",children:"Your savings already cover the corpus you need at these assumptions."})]})})]}),e.jsxs("section",{className:"calc-info",children:[e.jsx("h2",{children:"How this is worked out"}),e.jsx("p",{children:"Your monthly expenses grow with inflation until you retire. The corpus has to pay those expenses at the start of every month, still rising with inflation, until the age you plan for, while the remaining money keeps earning the return after retirement. Your existing savings grow at the pre-retirement return, and the rest is met by a monthly SIP."}),e.jsxs("p",{children:["All of these are assumptions: small changes in inflation or returns move the result a lot, so try a few. See also the ",e.jsx(h,{to:"/nps-calculator",children:"NPS calculator"})," and ",e.jsx(h,{to:"/goal-calculator",children:"goal calculator"}),"."]})]})]})}export{I as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.