Calculators · Gutenberg
Loan Calculator block for WordPress
Interactive mortgage and loan calculator with sliders for loan amount, interest rate, and term. Displays monthly payment, total interest, and total cost. Optional amortization schedule and doughnut chart.
Get Blockenberg
Free Gutenberg block in Blockenberg. The inspector controls and front-end behavior on this page come from this block’s source, not a shared stub.
What it actually does
Interactive mortgage and loan calculator with sliders for loan amount, interest rate, and term. Displays monthly payment, total interest, and total cost. Optional amortization schedule and doughnut chart.
Inspector panels on this block: Loan Amount, Interest Rate, Loan Term, Display. Those titles come from index.js, not from a shared template.
Behavior controls: “Currency symbol” options: $ (Dollar), € (Euro), £ (Pound), ¥ (Yen), A$ (AUD); “Currency position” options: Before ($ 500), After (500 $).
Where to find it
Gutenberg inserter → Calculators → search “Loan Calculator” (block name `blockenberg/loan-calculator` in block.json). Style it in the sidebar after insert.
How to use Loan Calculator block for WordPress
- Install Blockenberg. Install from WordPress.org and activate the plugin.
- Insert the block. Edit a page, click +, search for “Loan Calculator”, insert it. Category: Calculators.
- Configure inspector controls that exist on this block. Open Loan Amount. Set “Label”, “Default ($)”, “Minimum ($)”, “Maximum ($)”.
- Check the published page. The view script reads HTML data attributes: data-opts, data-result, data-slider. The block editor preview may not run the same view script.
Inspector controls from this block’s code
| Control | What the code does |
|---|---|
| Label | Text field in the inspector. block.json default: Loan Amount. Saved as `loanLabel`. |
| Default ($) | Numeric range control in the inspector. block.json default: 300000. Saved as `loanAmountDefault`. |
| Minimum ($) | Numeric range control in the inspector. Range 1000–500000. block.json default: 10000. Saved as `loanAmountMin`. |
| Maximum ($) | Numeric range control in the inspector. Range 50000–10000000. block.json default: 2000000. Saved as `loanAmountMax`. |
| Step ($) | Numeric range control in the inspector. Range 100–50000. block.json default: 5000. Saved as `loanAmountStep`. |
| Label (Interest Label) | Text field in the inspector. block.json default: Annual Interest Rate. Saved as `interestLabel`. |
| Default (%) | Numeric range control in the inspector. block.json default: 5.5. Saved as `interestDefault`. |
| Minimum (%) | Numeric range control in the inspector. Range 0.1–5. block.json default: 0.5. Saved as `interestMin`. |
| Maximum (%) | Numeric range control in the inspector. Range 5–30. block.json default: 20. Saved as `interestMax`. |
| Step (%) | Numeric range control in the inspector. Range 0.05–1. block.json default: 0.1. Saved as `interestStep`. |
| Label (Term Label) | Text field in the inspector. block.json default: Loan Term (years). Saved as `termLabel`. |
| Default (years) | Numeric range control in the inspector. block.json default: 25. Saved as `termDefault`. |
| Minimum (years) | Numeric range control in the inspector. Range 1–10. block.json default: 1. Saved as `termMin`. |
| Maximum (years) | Numeric range control in the inspector. Range 5–50. block.json default: 30. Saved as `termMax`. |
| Currency symbol | Select control; the chosen value is saved on the block. Options: $ (Dollar); € (Euro); £ (Pound); ¥ (Yen); A$ (AUD); C$ (CAD). block.json default: $. Saved as `currency`. |
| Currency position | Select control; the chosen value is saved on the block. Options: Before ($ 500); After (500 $). block.json default: before. Saved as `currencyPos`. |
| Max width (px) | Numeric range control in the inspector. Range 400–1200. block.json default: 760. Saved as `maxWidth`. |
| Show donut chart | On/off toggle in the inspector. On by default. Saved as `showChart`. |
| Show amortization table | On/off toggle in the inspector. Off by default. Saved as `showAmortization`. |
| Amortization rows | Numeric range control in the inspector. Range 3–60. block.json default: 12. Saved as `amortizationRows`. |
| Show CTA button | On/off toggle in the inspector. On by default. Saved as `showCta`. |
| CTA label | Text field in the inspector. block.json default: Apply Now. Saved as `ctaLabel`. |
| CTA URL | Text field in the inspector. block.json default: #. Saved as `ctaUrl`. |
| Open in new tab | On/off toggle in the inspector. Off by default. Saved as `ctaNewTab`. |
| Show disclaimer | On/off toggle in the inspector. On by default. Saved as `showDisclaimer`. |
| Disclaimer text | Multiline text field in the inspector. block.json default: This calculator is for illustrative purposes only. Actual rates may vary.. Saved as `disclaimer`. |
| Monthly payment size (px) | Numeric range control in the inspector. Range 24–80. block.json default: 48. Saved as `monthlySize`. |
| Card radius (px) | Numeric range control in the inspector. Range 0–32. block.json default: 16. Saved as `cardRadius`. |
| Button radius (px) | Numeric range control in the inspector. Range 0–32. block.json default: 8. Saved as `btnRadius`. |
| Padding top (px) | Numeric range control in the inspector. Range 0–200. block.json default: 60. Saved as `paddingTop`. |
| Padding bottom (px) | Numeric range control in the inspector. Range 0–200. block.json default: 60. Saved as `paddingBottom`. |
| Accent | Color control in the inspector. block.json default: #6c3fb5. Saved as `accentColor`. |
| Principal color | Color control in the inspector. block.json default: #6c3fb5. Saved as `principalColor`. |
| Interest color | Color control in the inspector. block.json default: #f59e0b. Saved as `interestColor`. |
| Monthly payment | Color control in the inspector. block.json default: #6c3fb5. Saved as `monthlyColor`. |
| Label text | Color control in the inspector. block.json default: #374151. Saved as `labelColor`. |
| Card background | Color control in the inspector. block.json default: #ffffff. Saved as `cardBg`. |
| Card border | Color control in the inspector. block.json default: #e5e7eb. Saved as `cardBorder`. |
| Results background | Color control in the inspector. block.json default: #f5f3ff. Saved as `resultBg`. |
| CTA background | Color control in the inspector. block.json default: #6c3fb5. Saved as `ctaBg`. |
| CTA text | Color control in the inspector. block.json default: #ffffff. Saved as `ctaColor`. |
| Block background | Color control in the inspector. Saved as `bgColor`. |
What the front-end script actually does
- The view script reads HTML data attributes: data-opts, data-result, data-slider.
- Charts are drawn with Chart.js in the browser from values saved on the block.
- JavaScript functions that perform the math: calcLoan.
When this is the right block
- Interactive mortgage and loan calculator with sliders for loan amount, interest rate, and term. Displays monthly payment, total interest, and total cost. Optional amortization schedule and doughnut chart — that is the job of Loan Calculator, not a generic content block.
- Use it when you need the editor control labeled “Label”, which exists on this block’s inspector.
- It matches pages about loan, mortgage, calculator.
- The math runs in the visitor’s browser after publish — no extra calculator plugin.
Notes from the implementation
viewScript: this folder’s frontend.js is enqueued on the front end for this block.
FAQ
How do I add the Loan Calculator block in WordPress?
Install Blockenberg from WordPress.org, edit a page in the block editor, click +, and search for “Loan Calculator”. It sits under Calculators. After insert, open Loan Amount and set “Label”, “Default ($)”, “Minimum ($)”, “Maximum ($)”.
Where do Loan Calculator submissions go?
The published page calls this block’s Blockenberg REST route (see front-end notes). The editor canvas does not send mail unless you preview on the front end.
Is the Loan Calculator Gutenberg block free?
Yes. Loan Calculator ships inside Blockenberg. Get the plugin from WordPress.org — no paid add-on is required for this block.
Can I style Loan Calculator to match my theme?
Yes. Blockenberg’s shared typography and color panels apply here, plus any block-specific style controls listed on this page (panels: Loan Amount, Interest Rate, Loan Term, Display).
Related calculators blocks
Mortgage Calculator
Calculate monthly mortgage payments with amortization table, principal vs interest breakdown, LTV ratio, and optional PMI estimate.
Debt Payoff Calculator
Compare Avalanche vs Snowball debt payoff strategies. Enter multiple debts, set a monthly payment budget, and see exactly when you'll be debt-free and how much interest you'll save.
Loan Affordability Calculator
Calculate how much home or loan you can afford based on annual income, existing debts, interest rate, and debt-to-income ratios. Ideal for real estate and finance sites.
Savings Calculator
An interactive compound interest savings calculator. Enter initial deposit, monthly contribution, annual interest rate, and years to see total savings, interest earned, and a year-by-year growth breakdown.
Compound Interest Calculator
Calculate compound interest growth with configurable compounding frequency, monthly contributions, and a year-by-year breakdown.
Currency Converter
Interactive currency converter supporting 30+ world currencies with instant conversion, swap button, common pairs quick-select, and customizable styling. Uses built-in indicative rates.
Get Blockenberg
Install Blockenberg from WordPress.org, then insert Loan Calculator from the Gutenberg inserter.