Home > widget-integration > FilterAPI > getCurrentGridColumns

FilterAPI.getCurrentGridColumns() method

Determines the number of columns currently rendered in the product grid.

Reads the live value tracked on the "grid" view-as icon (kept in sync with the actual rendered layout on load and on resize/breakpoint changes, and with the customer's manual grid-size selection when the theme offers one). Falls back to the desktop/mobile theme setting when that element isn't present (e.g. themes without a view-as toggle).

Signature:

protected getCurrentGridColumns(): number;

Returns:

number

Current grid column count