Overview
Font size (with theme presets), line height, and text alignment controls, wrapped in a ToolsPanel.
File: lib/blocks/components/MethodTypographyControls.js
Panel label: “Typography”
Props
Prop Type Default Description breakpointstring(required) The responsive breakpoint: base, mobile, tablet, or wide attributesobject(required) The block’s full attributes object setAttributesfunction(required) WordPress setAttributes function includestring[]['fontSize', 'lineHeight', 'textAlign']Which controls to render. Options: fontSize, lineHeight, textAlign, fontFamily, fontAppearance, textTransform, letterSpacing
This component does not accept an include prop — all three controls are always rendered.
Controls
Font Size
UI: FontSizePicker — WordPress’s native font size picker with optional preset sizes.
Settings key: responsiveSettings.{breakpoint}.fontSize
Value type: string (CSS value, e.g., "1.25rem", "18px")
Font size presets are pulled from window.methodGlobalData.fontSizePresets, which is localized from the theme’s method_get_font_size_presets() function. This gives editors a curated set of sizes while still allowing custom values.
Line Height
UI: RangeControl with decimal step increments.
Settings key: responsiveSettings.{breakpoint}.lineHeight
Value type: number
Parameter Value Min 0.75Max 2Step 0.05Initial position 1.55Marks 1, 1.5, 2
Text Alignment
UI: SelectControl dropdown.
Settings key: responsiveSettings.{breakpoint}.textAlign
Option Value Inherit "" (empty string)Left startCenter centerRight endJustify justify
Font Family
Settings key: responsiveSettings.{breakpoint}.fontFamily
UI: a Font Family picker populated from theme.json font families (custom, theme and default origins merged, as core’s typography panel does)
CSS: font-family
Font Appearance
Settings keys: fontStyle and fontWeight — one control, two stored values
UI: the combined style + weight control
CSS: font-style, font-weight
Letter Case
Settings key: textTransform
CSS: text-transform
Letter Spacing
Settings key: letterSpacing
CSS: letter-spacing
Reset all clears every typography key, the four above included.
ToolsPanel Behavior
Font Size: onSelect sets fontSize to empty string; onDeselect removes the key
Line Height: onSelect sets lineHeight to 1.55; onDeselect removes the key
Text Alignment: hasValue checks for both undefined and empty string; onDeselect removes the key
resetAll: Removes fontSize, lineHeight, and textAlign from the breakpoint
Usage by Blocks
Block Breakpoints Section base only Container base, mobile, tablet, wide Advanced Grid (grid + row + col) base, mobile, tablet, wide Button base, mobile, tablet, wide Core Extensions (paragraph, heading, list) mobile, tablet, wide only; the full set since beta18 Marquee base, mobile, tablet, wide — fontFamily, fontAppearance, fontSize, textTransform, letterSpacing
Changelog
Version Description 2.0.0-alpha4 Introduced (2e1bbd4 ). 2.0.0-beta17 include prop and four new opt-in controls — Font Family, Font Appearance, Letter Case, Letter Spacing — with the CSS on both sides; the default keeps the previous three (8db7ce9 ).