Skip to content
All effects

Live filter

Filter buttons above a list of posts or cards, and the list rearranges itself instantly with a smooth animation.

Interactive

This is the real effect. Scroll or move your mouse inside the frame to try it.

The prompt

Add a live filter to [the posts, products or cards I point to]: filter buttons above the list, and the list updates instantly with a smooth animation, without reloading the page. First ask me what should be filtered and by what (categories, tags, a custom field) if that is not clear from the page. Then add one button per option, plus All. Behaviour: buttons toggle on and off (aria-pressed); decide with me whether several can be on at the same time. Items that match stay; the others fade and shrink out, and the remaining items slide smoothly to their new place (use the FLIP technique: measure positions before and after, then animate the difference with transforms). Show a short line with the number of results, and a Clear button when a filter is active. Every item carries its filter keys in a data attribute, rendered from the real taxonomy or field of my CMS, so new items are filterable automatically. Accessibility: buttons are real buttons, the result count is in an aria-live region, hidden items are really hidden from screen readers after the animation. Respect prefers-reduced-motion by switching without the animation. Style: build it in the existing design system of this website. Reuse its colours, fonts, spacing, corner radius and existing classes or components, and don't add new colours or fonts. Use real content from this website for any text or images in the effect (its headings, services and copy), never placeholder text. If the project has no design system yet, ask me for the brand colours and fonts before you start.

What it is

A row of filter buttons above a list. Click one, and the matching items stay while the rest moves out of the way, right there on the page.

When it works

Blogs, portfolios, products, team pages. Anything with more than a handful of items. On the Living with Prompts blog and homepage the cards filter like this. You can even write the filter options as problems your customer recognises, instead of category names.

Get it right

  • Build the filter options from your real categories, so new items are filterable automatically.
  • Decide if visitors can pick one option or several.
  • Animate the cards to their new place, so people see what happened instead of a sudden jump.

Also called

  • Filter buttons
  • Category filter
  • Animated filter
  • Filter chips
  • Isotope filter

More effects.

All effects