Filters should always be in a fieldset with a legend for accesibility purposes.
It is acceptable to visually hide the fieldset with the
.sr-only css class.
Legends are used to provide context for multiple related inputs.
To use a legend, wrap your form inputs in a
<fieldset>and set the
<legend>as the first child.
By default the table caption is styled to match our standard body copy, but can be further styled by putting any of the text helper classes available on our typography page on the caption.
While some form elements's visual context can seem make a legend redundant, this may be less clear to users using screen reading devices. In this case an
sr-onlyclass can be used.