filter Component

Filter System

Horizontal Filter Bar - Basic Chips

Electronics 24
Clothing 156
Books 89
Home & Garden 45

Horizontal Filter - With Dropdowns & Search

Filter Sizes

Tiny
Filter
Options
Small
Filter
Options
Default
Filter
Options
Large
Filter
Options
Big
Filter
Options

Filter Colors

Primary
Option 2
Option 3
Positive
Option 2
Option 3
Negative
Option 2
Option 3
Warning
Option 2
Option 3

Vertical Filter Sidebar

Basic Vertical Filter

Category
124
89
45
67
Price Range
$0 $1000
Brand
23
45
18
12

Vertical Filter with Header & Footer

Filters
Expand all
Product Type
Customer Rating
142
298
412

Mobile Filter Components

Mobile Filter Trigger

Loading States

JavaScript Configuration

Filter Component Initialization

// Initialize filter component
const filter = new FilterComponent('.filter', {
    // Options
    onChange: function(filters) {
        console.log('Active filters:', filters);
    },
    onReset: function() {
        console.log('Filters reset');
    },
    debounce: 300,
    autoSubmit: true
});

// API Methods
filter.getActiveFilters();  // Get current filter state
filter.reset();            // Clear all filters
filter.apply();            // Apply current filters
filter.toggle(element);    // Toggle filter chip
filter.collapse(group);    // Collapse filter group
filter.expand(group);      // Expand filter group

Best Practices

  • Horizontal Filters: Best for 3-6 options, simple filtering needs
  • Vertical Filters: Ideal for 7+ options, complex filtering with categories
  • Mobile Considerations: Always provide a trigger button for mobile overlay
  • Performance: Debounce filter changes to avoid excessive updates
  • Accessibility: Use proper ARIA labels and keyboard navigation
  • Visual Feedback: Show active states, counts, and loading states
  • Clear Actions: Always provide reset/clear options