How can I apply the is-active class to my Webflow View-all radio button using FinSweet's attributes method for filtering a CMS of blog posts?
TL;DR
- Add
fs-cmsfilter-element="filter",fs-cmsfilter-field="[field-name]", andfs-cmsfilter-active(no value) to your "View All" radio button. - Leave
fs-cmsfilter-valueempty or set to match the unfiltered state, and ensure no other filters havefs-cmsfilter-activeby default for correct default selection andis-activeclass application.
To apply the is-active class to your "View All" radio button using FinSweet’s Attributes for CMS filtering, you need to configure it correctly based on their attribute documentation for active states.
1. Use the fs-cmsfilter-active Attribute
- FinSweet applies an active class (e.g.,
is-active) to elements that use the filter when the attributefs-cmsfilter-activeis present. - This applies to buttons, checkboxes, or radio buttons that act as filters.
- Your "View All" radio button must include both the filter group and the active-state attribute.
2. Add Necessary Attributes to the "View All" Button
- Ensure your "View All" radio button contains:
- fs-cmsfilter-element="filter"
- fs-cmsfilter-field="[field-name]"
- fs-cmsfilter-active
- Leave fs-cmsfilter-value empty or match it with the default/unfiltered state.
Example (in Designer custom attributes):
- fs-cmsfilter-element =
filter - fs-cmsfilter-field =
category(or your CMS field name) - fs-cmsfilter-value = `` (empty string or "All" depending on your config)
- fs-cmsfilter-active (added without a value)
3. Set the Default Active Filter
- If you want "View All" to be the default option when the page loads, make sure:
- It is the only radio filter set with the
fs-cmsfilter-activeattribute when the page initializes. - All other filter buttons (other categories) do not have the
fs-cmsfilter-activeattribute by default.
4. Add and Style the is-active Class
- Webflow and FinSweet will automatically add the
is-activeclass to whichever filter has thefs-cmsfilter-activeattribute. - Style the
is-activeclass in Webflow’s Style panel to define how the active button looks.
5. Optional: Ensure Filter Type Is Set
- If you are grouping radio buttons, make sure they share the same fs-cmsfilter-field.
- Your other radio buttons should have the same
fs-cmsfilter-element="filter"and relevantfs-cmsfilter-field, but differentfs-cmsfilter-value.
Summary
To apply the is-active class to your "View All" radio filter in Webflow using FinSweet Attributes, add fs-cmsfilter-active along with the proper field and value. FinSweet will toggle the is-active class automatically based on user interaction or default page load.