MethodBreakpointSelect

 
 
 
 

Overview

A select of the theme’s Bootstrap breakpoint keys — xs, sm, md, lg, xl, xxl as the theme configures them — that stores the chosen key in a block attribute, for settings like “sticky from this width up”.


Props

PropTypeDefaultDescription
labelstring(required)The control’s label.
attributeKeystring(required)The attribute that holds the breakpoint key (for Scrollspy, stickyAt).
attributesobject(required)The block’s full attributes object.
setAttributesfunction(required)WordPress setAttributes.

Controls

Breakpoint

  • Value: The breakpoint key (md, say), never the pixel value. The block resolves it to pixels where it needs them.
  • Options: One per entry of the theme’s breakpoints.dimensions (from METHOD_CHILD_OPTIONS, else METHOD_OPTIONS): key, name (the key upper-cased) and hint (the value plus the configured unit, e.g. 768px).
  • Unset: No “none” option; the attribute’s default in block.json is the initial selection.

CSS Output

None. The stored key is data for the block: Scrollspy looks it up in method_get_all_bs_breakpoint_options() on render and prints the pixel hint as data-sticky-at, which its view script turns into a matchMedia() query.


Usage by Blocks

BlockNotes
Scrollspy“Width to Become Sticky” → stickyAt (default md).
method/navbarNot registered — the block is commented out in lib/blocks.php.

Changelog

VersionDescription
2.0.0-beta5Introduced, with the Scrollspy block (ccc789b).