Skip to content

Filter group

An Accordion holding a fieldset of checkboxes. The controls are plain form fields, so a set of filter groups inside a GET form filters without any script. When any option has a color, the group renders colour dots beside each checkbox.

Category
Category
  • title: shown in the accordion summary and as the fieldset legend (required)
  • name: form field name shared by every option (required); ids are built from it, so keep it unique on a page
  • options: list of { label, value, count, color, checked } (required). count is shown in brackets
  • open: starts expanded (default true)
<FilterGroup
title="Category"
name="category"
options={[
{ label: "Clothing", value: "clothing", count: 24, checked: true },
{ label: "Home", value: "home", count: 18 },
]}
/>
Colour options, starting closed
Colour
Colour