Facet Types Reference

Complete configuration reference for all 14 built-in facet types. Every field listed here maps to a key in the facet's config JSON column.

checkbox

Checkbox

Multi-select checkbox list. The most common facet type. Supports OR (any match), AND (all must match), and NOT (exclude) operators. Values come from the index table.

Config FieldTypeDefaultDescription
operatorOR | AND | NOTORHow multiple selections combine: OR = any match, AND = all must be present, NOT = exclude matching posts.
show_countbooltrueDisplay item count beside each checkbox label.
show_more_countint5Number of items visible before the Show More button appears. 0 = show all.
show_searchboolfalseShow a text input above the list to filter visible checkboxes client-side.
show_clear_buttonbooltrueShow a Clear link to deselect all checkboxes in this facet.
hide_emptyboolfalseHide items that have zero posts in the current filtered result set.
show_empty_as_disabledboolfalseShow zero-count items as greyed-out disabled checkboxes instead of hiding them. Takes precedence over hide_empty.
max_selectionsint0Maximum number of items that can be selected simultaneously. 0 = unlimited.
order_bycount | name | idcountHow to sort the checkbox list.
orderasc | descdescSort direction.
min_countint0Minimum post count an item must have to appear in the list.
hierarchicalboolfalseRender as an indented hierarchy using depth/parent data from the index table. Only meaningful for hierarchical taxonomies.
search_placeholderstringSearch…Placeholder text for the client-side search input.
show_more_labelstringShow MoreLabel for the show-more button.
show_less_labelstringShow LessLabel for the collapse button.
AND operator works correctly for taxonomy sources — each selection generates a separate tax_query clause. For post_meta, AND generates multiple meta_query clauses. NOT uses NOT IN for taxonomy and meta sources.
radio

Radio

Single-select radio buttons. Only one value can be active at a time. Commonly used for sorting, status filters, or any exclusive-choice facet. Optionally shows an 'All' option to clear the selection.

Config FieldTypeDefaultDescription
show_all_optionbooltruePrepend an 'All' radio option that clears the facet when selected.
all_labelstringAllLabel for the All option.
all_count_displaytotal | nonetotalWhether to show the total post count beside the All option.
show_countbooltrueShow post counts beside each option.
show_more_countint0Items visible before Show More. 0 = show all.
show_searchboolfalseShow a filter-as-you-type input above the list.
show_clear_buttonboolfalseShow an explicit Clear link.
hide_emptyboolfalseHide zero-count options.
show_empty_as_disabledboolfalseShow zero-count options as disabled.
order_bycount | name | idcountSort order for the options list.
orderasc | descdescSort direction.
min_countint0Minimum post count to appear.
button_group

Button Group

Pill-style clickable buttons arranged in a wrap or horizontal-scroll layout. Works as either single-select or multi-select. Commonly used for size, category, or tag filters where visual buttons are preferred over checkboxes.

Config FieldTypeDefaultDescription
multipleboolfalseEnable multi-select mode.
operatorOR | AND | NOTORCombine operator for multi-select.
max_selectionsint0Maximum selections in multi-select mode.
show_all_optionboolfalseShow an 'All' button that clears the filter. Single-select only.
all_labelstringAllLabel for the All button.
show_countbooltrueShow count badge on each button.
show_clear_buttonboolfalseShow a Clear link below the buttons.
button_sizesm | md | lgmdButton size preset.
button_layoutwrap | scrollwrapwrap wraps to multiple lines; scroll keeps one row with horizontal scroll.
show_more_countint0Items visible before Show More. 0 = show all.
show_more_labelstringShow More
show_less_labelstringShow Less
hide_emptyboolfalseHide zero-count buttons.
show_empty_as_disabledboolfalseShow zero-count buttons as disabled instead of hiding.
min_countint0Minimum post count.
order_bycount | name | idcountSort order.
orderasc | descdescSort direction.
range

Range Slider

A dual-handle slider for numeric ranges. Min and max bounds are automatically derived from the index table at render time and can be overridden in config. The slider generates a BETWEEN meta_query clause.

Config FieldTypeDefaultDescription
prefixstring''Text prepended to the value display, e.g. '$'.
suffixstring''Text appended to the value display, e.g. ' km'.
decimalsint (0–6)0Number of decimal places in input and display.
thousands_separatorstring''Thousands separator: '' | ',' | '.' | ' '.
decimal_separator. | ,.Decimal point character.
stepfloat (>0)1Slider step increment. Must be positive; supports fractional steps.
min_overridefloat | ''''Force a minimum bound instead of reading from the index.
max_overridefloat | ''''Force a maximum bound instead of reading from the index.
show_inputsbooltrueShow numeric text inputs beside the slider.
show_sliderbooltrueShow the graphical slider. Can be disabled to show inputs only.
show_clear_buttonbooltrueShow a Clear link to reset to full range.
value_displayrange | separate | nonerangeHow to display the current value: 'range' = '$25–$200', 'separate' = two values, 'none' = hidden.
min_labelstringMinLabel for the minimum input.
max_labelstringMaxLabel for the maximum input.
WooCommerce price fields (wc:price, wc:sale_price, wc:regular_price, wc:rating, wc:weight) are automatically mapped to their internal meta keys (_price, _wc_average_rating, _weight, etc.).
date_range

Date Range

Filter posts by a date range. Two modes: date picker inputs (from/to) or preset quick-select buttons (Last 7 Days, This Month, etc.). Works with post_date, post_modified, and any date-formatted meta field.

Config FieldTypeDefaultDescription
preset_modeboolfalseShow preset buttons instead of date picker inputs.
from_labelstringFromLabel for the start date input.
to_labelstringToLabel for the end date input.
min_dateYYYY-MM-DD | ''''Earliest selectable date. Empty = no constraint.
max_dateYYYY-MM-DD | ''''Latest selectable date. Empty = no constraint.
date_formatstringY-m-dPHP date format for display and parsing.
show_clear_buttonbooltrueShow a Clear link to reset the date range.
Built-in presets: last_7_days, last_30_days, this_month, last_month, last_3_months, last_6_months, this_year, last_year, all_time, custom. For post_date sources the query uses date_query; for meta fields it uses meta_query with BETWEEN and type=DATE.
autocomplete

Autocomplete

AJAX-powered typeahead input. As the user types, it fetches matching values from GET /wp-json/gridpanda/v1/facets/{id}/autocomplete?q=... and displays them as a dropdown. Supports single and multi-select (tag input).

Config FieldTypeDefaultDescription
placeholderstringType to search…Input placeholder text.
min_charactersint (≥1)2Characters needed before the first AJAX request fires.
debounceint (≥50)300Delay in ms after last keystroke before the request fires.
multi_selectboolfalseAllow selecting multiple values as tags.
max_tagsint10Maximum tags in multi-select mode. 0 = unlimited.
operatoror | andorCombine multiple selections with OR or AND.
include_childrenbooltrueInclude child terms when filtering by taxonomy. Passed to tax_query.
show_countboolfalseShow post count beside each suggestion in the dropdown.
show_clear_buttonbooltrueShow a Clear button to remove all selections.
rating

Rating

Star rating filter for numeric rating fields. Typically used with WooCommerce's _wc_average_rating meta key. Supports 'and up' mode (show all posts rated X or higher) or exact tier matching. Tier counts are accumulated from the index.

Config FieldTypeDefaultDescription
max_starsint (1–10)5Maximum rating level. Controls how many rating tiers are shown.
min_ratingint (1–max_stars)1Minimum rating tier to display as an option.
filter_modegte | exactgtegte = show posts rated at or above the selected value. exact = show posts where the rating floor equals the selection.
layoutstacked | inlinestackedstacked = one tier per row; inline = all tiers in one row.
star_iconstar | heart | circle | diamond | fire | thumbsup | customstarIcon to use for rating display.
custom_iconstring''HTML/SVG string used when star_icon=custom.
label_formatand_up | stars | icon_only | custom | noneand_upHow to label each tier: '3 & up', '★★★', icons only, custom template, or no label.
custom_labelstring{n} and upTemplate for label_format=custom. {n} is replaced with the tier number.
show_countbooltrueShow accumulated post count beside each tier.
show_clear_buttonbooltrueShow a Clear link.
The rating index must contain decimal values (e.g., 4.5, 3.2). Grid Panda floors each value to determine its tier and accumulates counts upward — the count for tier 3 includes all posts rated 3.0 and above.
color

Color Swatch

A grid or list of color swatches for visual color filtering. Each swatch maps a facet value (e.g. term slug 'red') to a hex color code or CSS gradient. Unmapped values are rendered without a color background.

Config FieldTypeDefaultDescription
color_mapobject {slug: '#rrggbb'}{}Map of facet value slugs to hex color codes.
gradient_mapobject {slug: 'linear-gradient(...)'}{}Map of slugs to CSS gradient strings for multi-color swatches.
operatoror | andorCombine multiple swatch selections. AND only meaningful for taxonomy sources.
hide_emptyboolfalseHide swatches with zero post counts.
only_mappedboolfalseShow only swatches that appear in color_map or gradient_map — hide unmapped values.
swatch_sizeCSS length36pxWidth and height of each swatch.
swatch_shapecircle | square | roundedcircleShape of the color swatches.
layoutgrid | listgridGrid wraps multiple swatches per row; list shows one per row with label.
show_labelbooltrueShow the value label below or beside the swatch.
show_countboolfalseShow post count beside each swatch.
show_tooltipbooltrueAdd a title attribute to show label on hover.
show_clear_buttonbooltrueShow a Clear link.
selection_indicatorcheckmark | ring | border | dotcheckmarkHow to visually indicate a selected swatch.
selection_colorCSS color | ''''Color of the selection indicator. Empty = auto-contrast.
toggle

Toggle

A binary on/off switch. When toggled on, filters posts where the configured field equals on_value. When off, no filter is applied. Common use cases: In Stock only, Featured posts, On Sale items.

Config FieldTypeDefaultDescription
on_valuestring'1'The field value that the toggle filters for when active. For a boolean meta field this is typically '1'; for taxonomy it is a term slug.
off_valuestring'0'Display-only label for the inactive state. Not used in queries.
label_onstringYesLabel shown in the active state.
label_offstringNoLabel shown in the inactive state.
show_labelbooltrueShow the label beside the toggle switch.
show_countboolfalseShow the count of matching posts beside the label.
show_clear_buttonboolfalseShow a Clear link.
For taxonomy sources, the toggle generates a tax_query for the slug in on_value with include_children=false. For post_meta sources it generates meta_query compare='='. For recognized post fields (post_status, post_author, post_type, etc.) it sets the field directly in WP_Query args.
hierarchy

Hierarchy

Collapsible tree filter for hierarchical WordPress taxonomies (categories, product categories, etc.). Uses the depth and parent_id columns in the index table to reconstruct the tree without extra DB queries.

Config FieldTypeDefaultDescription
max_depthint0Maximum depth levels to display. 0 = show all levels.
include_childrenbooltrueWhen a parent term is selected, also include child term posts in the query result.
expand_modeall | collapsed | firstallInitial expand state: all = expand everything, collapsed = all collapsed, first = only first level expanded.
show_countbooltrueShow post counts beside each term.
show_clear_buttonbooltrueShow a Clear link.
Only works with taxonomy sources backed by hierarchical taxonomies. The tree is built in two passes: first all nodes are mapped by slug, then parent-child relationships are wired using the index's parent_id (WP term_id) → parent slug resolution.
sort

Sort

A sort-order control rendered as a dropdown, radio buttons, or pill buttons. Unlike other facet types, Sort does not filter posts — it modifies the WP_Query orderby and order arguments. Each option is fully configurable.

Config FieldTypeDefaultDescription
render_typedropdown | radio | button_groupdropdownHow to render the sort control.
default_sortstringnewestThe sort option slug to use when no selection is active.
relevance_on_searchbooltrueAutomatically switch to relevance sort when a search facet is active.
show_placeholderboolfalseShow a placeholder option in dropdown mode.
placeholderstring— Sort by —Placeholder label for dropdown mode.
sort_optionsarray of objectssee defaultsArray of sort option definitions. Each object must have: value (slug), label, orderby, order (ASC|DESC). Optional: meta_key (for meta_value/meta_value_num orderby), meta_type (NUMERIC|DECIMAL|DATE|DATETIME|BINARY), icon.
Default sort_options provide: newest (date DESC), oldest (date ASC), title_asc (title ASC), title_desc (title DESC). Any WP_Query orderby value is supported — date, title, modified, comment_count, ID, rand, meta_value, meta_value_num, etc.
active_filters

Active Filters

Displays the currently-active filter selections as removable pills. This is a pure UI widget — it adds nothing to the WP_Query and does not need indexing. The pills are populated by JavaScript after the page loads and update dynamically as filters change.

Config FieldTypeDefaultDescription
show_clear_allbooltrueShow a 'Clear All' button that removes all active filters at once.
show_facet_labelbooltruePrefix each pill with the facet name (e.g. 'Color: Red').
clear_all_labelstringClear AllLabel for the Clear All button.
Place this facet at the top of your filter sidebar or above the grid for best UX. It renders an empty container server-side and is fully populated by the Grid Panda JS runtime after load.