MethodAddtControls

 
 
 
 

Overview

Overflow and z‑index controls for fine‑tuning block stacking and clipping behavior, wrapped in a ToolsPanel.

  • File: lib/blocks/components/MethodAddtControls.js
  • Panel label: “Additional Options” (customizable via label prop)

Props

PropTypeDefaultDescription
breakpointstring(required)The responsive breakpoint to read/write: base, mobile, tablet, or wide
attributesobject(required)The block’s full attributes object
setAttributesfunction(required)WordPress setAttributes function
labelstring'Additional Options'Custom label for the ToolsPanel heading
includestring[]['overflow', 'zIndex']Which controls to render. Options: overflow, zIndex

Controls

Overflow

  • UI: SelectControl dropdown.
  • Settings key: responsiveSettings.{breakpoint}.overflow
OptionValueDescription
VisiblevisibleContent is not clipped (default CSS behavior)
HiddenhiddenContent is clipped with no scrollbars
ScrollscrollContent is clipped with scrollbars always visible
AutoautoScrollbars appear only when content overflows
ClipclipContent is clipped at the element’s overflow clip edge

Z‑Index

  • UI: NumberControl (experimental) with shift‑step of 10 for quick large adjustments.
  • Settings key: responsiveSettings.{breakpoint}.zIndex
  • Value type: integer (parsed via parseInt on change)

The shiftStep of 10 means holding Shift while pressing the up/down arrows increments by 10 instead of 1, making it fast to jump between stacking layers.


ToolsPanel Behavior

  • Overflow onSelect: Initializes to 'visible'
  • Overflow onDeselect: Removes the overflow key entirely from the breakpoint settings
  • Z‑Index onSelect: Initializes to 0
  • Z‑Index onDeselect: Removes the zIndex key entirely
  • resetAll: Removes both overflow and zIndex from the breakpoint

CSS Output

When consumed by MethodStyleTag, the settings keys map to CSS properties:

Settings KeyCSS Property
overflowoverflow
zIndexz-index

Usage by Blocks

BlockIncluded ControlsCustom Label
SectionzIndex
Containeroverflow, zIndex