Skip to content

Filter List

Shows a list of components with a filter.

Specifications

Properties

PropertyTypeDescriptionRequiredDefault
enable_compareboolean Option to include compare header and cart componentNofalse
filterobject See filter component for detailed description of optionsYes-
slotstring Main content slot. Place inner components to be filtered here.Yes-

Changelog

6.8.2 (2024-04-02)

  • fix: set color of border correctly (65107b9)

1.1.0

  • filter-list added

Contains

Other core components embedded within this template.

Examples

Default

Filter Items

x results

One / Business

Elit Ornare

Aenean lacinia bibendum nulla sed consectetur.

One / Education

Malesuada Vehicula

Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

Two / Education

Mattis Lorem

Donec ullamcorper nulla non metus auctor fringilla.

Two / Business

Ridiculus Inceptos

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

    {% import "macros/program-card.twig" as program_card %}
    
    {% set filter_data = {
    	enable_search: true,
    	class: 'tux-c-filter--vertical',
    	enable_reset: true,
    	filter_title: 'Filter Items',
    	attributes: [
    		{
    			label: 'Level',
    			default: 'Select Level',
    			name: 'level_of_study',
    			type: 'accordion_filter',
    			options: [
    				{
    					value: 'level_of_study-one',
    					label: 'One'
    				},
    				{
    					value: 'level_of_study-two',
    					label: 'Two'
    				},
    				{
    					value: 'level_of_study-three',
    					label: 'Three'
    				}
    			]
    		},
    		{
    			label: 'Area',
    			default: 'Select Area',
    			name: 'area_of_study',
    			type: 'accordion_filter',
    			options: [
    				{
    					value: 'area_of_study-business',
    					label: 'Business'
    				},
    				{
    					value: 'area_of_study-education',
    					label: 'Education'
    				}
    			]
    		}
    	]
    } %}
    
    {% set items = [
    	{
    		action_label: 'View Item',
    		class: 'mix level_of_study-one area_of_study-business',
    		content: '<p>Aenean lacinia bibendum nulla sed consectetur.</p>',
    		heading: 'Elit Ornare',
    		id: 1,
    		terms: 'One / Business',
    		url: '#'
    	},
    	{
    		action_label: 'View Item',
    		class: 'mix level_of_study-one area_of_study-education',
    		content: '<p>Praesent commodo cursus magna, vel scelerisque nisl consectetur et.</p>',
    		heading: 'Malesuada Vehicula',
    		id: 2,
    		terms: 'One / Education',
    		url: '#'
    	},
    	{
    		action_label: 'View Item',
    		class: 'mix level_of_study-two area_of_study-education',
    		content: '<p>Donec ullamcorper nulla non metus auctor fringilla.</p>',
    		heading: 'Mattis Lorem',
    		id: 3,
    		terms: 'Two / Education',
    		url: '#'
    	},
    	{
    		action_label: 'View Item',
    		class: 'mix level_of_study-two area_of_study-business',
    		content: '<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>',
    		heading: 'Ridiculus Inceptos',
    		id: 4,
    		terms: 'Two / Business',
    		url: '#'
    	}
    ] %}
    
    <x-filter-list :filter="filter_data">
    	{% for item in items %}
    		<x-card
    			:class="item.class"
    			:footer="program_card.footer(item)"
    			:content="program_card.content(item)"
    			:footer="program_card.footer(item)"
    			:attrs="{'data-title': item.heading|lower ~ item.content|lower|striptags}"
    		/>
    	{% endfor %}
    </x-filter-list>