Calculators · Gutenberg

Heart Rate Calculator block for WordPress

Calculate target heart rate training zones based on age and formula.

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.

Get Blockenberg

What it actually does

Calculate target heart rate training zones based on age and formula.

Inspector panels on this block: Content, Zone Colors, Theme Colors, Sizing. Those titles come from index.js, not from a shared template.

Behavior controls: “Default Formula” options: Fox (220 − age), Tanaka (208 − 0.7×age), Gellish (207 − 0.7×age).

Where to find it

Gutenberg inserter → Calculators → search “Heart Rate Calculator” (block name `blockenberg/heart-rate-calculator` in block.json). Style it in the sidebar after insert.

How to use Heart Rate Calculator block for WordPress

  1. Install Blockenberg. Install from WordPress.org and activate the plugin.
  2. Insert the block. Edit a page, click +, search for “Heart Rate Calculator”, insert it. Category: Calculators.
  3. Configure inspector controls that exist on this block. Open Content. Set “Content — Title”, “Subtitle”, “Default Age”, “Default Formula”.
  4. Check the published page. The view script reads HTML data attributes: data-opts. The block editor preview may not run the same view script.

Inspector controls from this block’s code

ControlWhat the code does
Content — TitleText field in the inspector. block.json default: Heart Rate Zone Calculator. Saved as `title`.
SubtitleText field in the inspector. block.json default: Find your personalized training zones based on your age. Saved as `subtitle`.
Default AgeNumeric range control in the inspector. Range 18–80. block.json default: 30. Saved as `defaultAge`.
Default FormulaSelect control; the chosen value is saved on the block. Options: Fox (220 − age); Tanaka (208 − 0.7×age); Gellish (207 − 0.7×age). block.json default: fox. Saved as `defaultFormula`.
Show Zone IconOn/off toggle in the inspector. On by default. Saved as `showZoneIcon`.
Show Zone PurposeOn/off toggle in the inspector. On by default. Saved as `showPurpose`.
Zone 1 — RecoveryColor control in the inspector. block.json default: #6ee7b7. Saved as `z1Color`.
Zone 2 — Fat BurnColor control in the inspector. block.json default: #34d399. Saved as `z2Color`.
Zone 3 — AerobicColor control in the inspector. block.json default: #fbbf24. Saved as `z3Color`.
Zone 4 — ThresholdColor control in the inspector. block.json default: #f97316. Saved as `z4Color`.
Zone 5 — Max EffortColor control in the inspector. block.json default: #ef4444. Saved as `z5Color`.
AccentColor control in the inspector. block.json default: #ef4444. Saved as `accentColor`.
Section BackgroundColor control in the inspector. block.json default: #fff7f7. Saved as `sectionBg`.
Card BackgroundColor control in the inspector. block.json default: #ffffff. Saved as `cardBg`.
Input BackgroundColor control in the inspector. block.json default: #f9fafb. Saved as `inputBg`.
Title ColorColor control in the inspector. block.json default: #111827. Saved as `titleColor`.
Subtitle ColorColor control in the inspector. block.json default: #6b7280. Saved as `subtitleColor`.
Label ColorColor control in the inspector. block.json default: #374151. Saved as `labelColor`.
Max Width (px)Numeric range control in the inspector. Range 400–1400. block.json default: 760. Saved as `contentMaxWidth`.

What the front-end script actually does

When this is the right block

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 Heart Rate Calculator block in WordPress?

Install Blockenberg from WordPress.org, edit a page in the block editor, click +, and search for “Heart Rate Calculator”. It sits under Calculators. After insert, open Content and set “Content — Title”, “Subtitle”, “Default Age”, “Default Formula”.

Does Heart Rate Calculator need a server or extra plugin?

No. After Blockenberg is active, the view script runs in the browser with the values you saved on the block.

Is the Heart Rate Calculator Gutenberg block free?

Yes. Heart Rate Calculator ships inside Blockenberg. Get the plugin from WordPress.org — no paid add-on is required for this block.

Can I style Heart Rate 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: Content, Zone Colors, Theme Colors, Sizing).

Related calculators blocks

Get Blockenberg

Install Blockenberg from WordPress.org, then insert Heart Rate Calculator from the Gutenberg inserter.

Get Blockenberg