# Create a Filter

{% embed url="<https://youtu.be/REZx7Ffgv9s?feature=shared&t=233>" %}

The `filter` block is able to filter anything inside a `query` block.

The `filter` block is usually inserted into a parent block.

## Toggle on Frontend Rendering

* Select the Query in the navigator.
* In the Primary tab of the block Inspector open the Settings tab.
* Toggle on Frontend Rendering.

{% hint style="warning" %}
The `filter` block will only work with a `query`block that has the front end rendering property toggled on.
{% endhint %}

<figure><img src="https://3250709389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS33S0eoYwMaMrLb7T_%2Fuploads%2Ft2KnEDjxzy6OIS9cwxZX%2Fselect%20query%20and%20front%20rendering.jpg?alt=media&#x26;token=0a521b89-ce40-4348-ab31-6fcc95adf312" alt=""><figcaption></figcaption></figure>

## Categories

For this example, we have already set up our Categories in the WordPress Dashboard.&#x20;

* Navigate to the Dashboard.
* Open the Categories tab and add new categories as required.
* In this example we have set up 3 categories.

<figure><img src="https://3250709389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS33S0eoYwMaMrLb7T_%2Fuploads%2FM19EhhiLaFkjuOhE1GzF%2FScreenshot%202023-08-13%20at%2018.30.08.png?alt=media&#x26;token=b9c4686a-608c-4c45-81f4-aaee1d10e1ad" alt=""><figcaption></figcaption></figure>

## Set up Filter

* Select Query in the Navigator.
* In the Primary Tab of the Block Inspector, open the Query Editor.
* Open "Taxonomy Query".

<figure><img src="https://3250709389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS33S0eoYwMaMrLb7T_%2Fuploads%2F5zGcKcuXcW4BUqkpY0iH%2Fopen%20query%20editor%202.jpg?alt=media&#x26;token=cba3b8cb-f63e-4c8d-9bda-f565b60e994c" alt=""><figcaption></figcaption></figure>

### Open

* Click the "+" icon to add a new Taxonomy Query.
* Click to open.

<figure><img src="https://3250709389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS33S0eoYwMaMrLb7T_%2Fuploads%2FCxDjTL018v4U9782U0hg%2Fclick%20add%20new%20taxonomy%20query.jpg?alt=media&#x26;token=d343b8d8-e5e2-48f3-815f-6a9bd46dd28b" alt=""><figcaption></figcaption></figure>

### Rename

You can give you taxonomy filter a suitable name.

* Find the Name field.
* Input a suitable name.

<figure><img src="https://3250709389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS33S0eoYwMaMrLb7T_%2Fuploads%2FcapVeJIVKP4raFT4kCr9%2Frename%20taxonomy%20query.jpg?alt=media&#x26;token=dc869016-d323-409a-93e3-72a66f6deeba" alt=""><figcaption></figcaption></figure>

### Set Taxonomy Filter

In order to target Categories, you need to filter a Taxonomy, such as Categories, Tags, Navigation Menus, Link Categories, Formats, Themes, Tenplate Part Areas etc.

In this example, we wish to target Categories.

* Set Taxonomy to "Categories - Post".

<figure><img src="https://3250709389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS33S0eoYwMaMrLb7T_%2Fuploads%2F62XYnlZYVsdQ7UqBWGPZ%2Ftarget%20categories.jpg?alt=media&#x26;token=40829b6e-5ce9-406b-8479-959d43943cf2" alt=""><figcaption></figcaption></figure>

### Dynamic Toggle

In order to filter dynamic data, you need to toggle on the Dynamic icon.

* Find Terms.
* Toggle on the "Dynamic" icon.

<figure><img src="https://3250709389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS33S0eoYwMaMrLb7T_%2Fuploads%2F0iO16Nv1LqSZz46JeDFL%2Fclick%20dynamic%20icon.jpg?alt=media&#x26;token=8dde80d7-00e0-46ec-a81a-ba4726b03bb7" alt=""><figcaption></figcaption></figure>

### Source

* Set Source to "WordPress".

<figure><img src="https://3250709389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS33S0eoYwMaMrLb7T_%2Fuploads%2FzoKt4beDPj4LQ8pcJ7ja%2Fset%20source%20to%20wordpress.jpg?alt=media&#x26;token=0c90494b-6b84-4ba3-bd55-9708bc457ebd" alt=""><figcaption></figcaption></figure>

The Filter block adds or removes a parameter that the Query then uses to modify the information that it displays.

* Set Wordpress to "URL Parameter".

<figure><img src="https://3250709389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS33S0eoYwMaMrLb7T_%2Fuploads%2FWfY82z5zQgfCNEjPm3mB%2Fset%20wordpress%20to%20url%20parameter.jpg?alt=media&#x26;token=0b26e198-5c26-4059-8d3b-910937516fb5" alt=""><figcaption></figcaption></figure>

### Key

You need to input the filter target name, in this example "Category".

* Input "Category" as Key.&#x20;

<figure><img src="https://3250709389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS33S0eoYwMaMrLb7T_%2Fuploads%2Ftup68rHzpti02frc11QI%2Finput%20category%20as%20name.jpg?alt=media&#x26;token=36bea927-74f5-48c7-8f5c-78f012cc4d70" alt=""><figcaption></figcaption></figure>

### Field

By default, the filter returns taxonomy slugs. If required, you can set it to another parameter such as term\_id, name, term-taxonomy\_id. In this example we wish to return "slugs".

* Select "slug" as Field in the Dropdown.

<figure><img src="https://3250709389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS33S0eoYwMaMrLb7T_%2Fuploads%2FZO2ebLd0TrfuryvYui4e%2Fselect%20slug.jpg?alt=media&#x26;token=2e675a09-a192-469d-b1a4-5bad5b1662ea" alt=""><figcaption></figcaption></figure>

## Copy Query ID

You need to copy the query ID so that the Filter can attach to the Query.

* Find Query ID.
* Copy using keyboard shortcuts.

<figure><img src="https://3250709389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS33S0eoYwMaMrLb7T_%2Fuploads%2FJZmA93FmiN9qVpCUImX5%2Fcopy%20query%20id.jpg?alt=media&#x26;token=7a11076d-2173-4493-86ec-a52b9f0b1339" alt=""><figcaption></figcaption></figure>

## Add Filter

Now we need to add our Filter. You can place it where you need it as required.

In this example we will place it above the Query.

* Select the block into which you want to insert the Filter.
* Add a Cwicly Filter block using the Quick Inserter or the Block Inserter.

<figure><img src="https://3250709389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS33S0eoYwMaMrLb7T_%2Fuploads%2FgdtjK94dNSb4jrWCk51U%2FScreenshot%202023-08-14%20at%2011.06.19.png?alt=media&#x26;token=24c8a903-9f60-47a7-904d-d7fdf3d0ebb7" alt=""><figcaption></figcaption></figure>

* You should see a placeholder with "Select Filter Properties...".

<figure><img src="https://3250709389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS33S0eoYwMaMrLb7T_%2Fuploads%2Fwcmh2EHChOvtaj6ykptz%2FScreenshot%202023-08-14%20at%2011.10.35.png?alt=media&#x26;token=5fa3fb5c-89ff-4d73-960d-aaba6c2d7a33" alt=""><figcaption></figcaption></figure>

* Click to open the Filter Editor from the Primary tab.

<figure><img src="https://3250709389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS33S0eoYwMaMrLb7T_%2Fuploads%2FWeU3V4FReNfBjPY4HPK0%2FScreenshot%202023-08-14%20at%2011.14.32.png?alt=media&#x26;token=a3589882-82b8-4964-92ac-8a5e5cf165a0" alt=""><figcaption></figcaption></figure>

## Connect Filter to Query

First we need to connect the Filter to the Query using the Query ID.&#x20;

### Query ID

* In the Query Editor modal, input the ID of the Query to which you wish to attach the filter.

![](https://3250709389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS33S0eoYwMaMrLb7T_%2Fuploads%2Fd540TDiGmvivNnpg3syV%2FScreenshot%202023-08-14%20at%2011.22.21.png?alt=media\&token=6255f471-ca50-4f2f-a829-a2292c1e3c30)

You can find the Query ID in the Query Editor.

* Select the Query to which you want to attach the Filter.
* In the Primary tab, open the Query Editor.
* Copy the Query ID.

<figure><img src="https://3250709389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS33S0eoYwMaMrLb7T_%2Fuploads%2FGh9oOE1I85nHPW1ykYvs%2FScreenshot%202023-08-14%20at%2011.19.53.png?alt=media&#x26;token=1c326024-efcf-42bb-8bfb-4cf39cdaf9c7" alt=""><figcaption></figcaption></figure>

* Input the required Target, in this example "category".

<figure><img src="https://3250709389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS33S0eoYwMaMrLb7T_%2Fuploads%2Flr3XWrXrq7iPzM8aYOUZ%2FScreenshot%202023-08-14%20at%2011.30.17.png?alt=media&#x26;token=89fb6ae4-4296-4e77-b358-d3e8c2952b43" alt=""><figcaption></figcaption></figure>

### Target

The Target is in fact the key that you chose when you set up the Query. You will find it in the Taxonomy Query tab of the Query Editor.

* Select the Query.
* Open the Query Editor.
* Open the Taxonomy Query tab.
* Click the required Query, in this example the "Travel Query".

<figure><img src="https://3250709389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS33S0eoYwMaMrLb7T_%2Fuploads%2Fnt5sF3ZVPOsE1rDBfj6a%2FScreenshot%202023-08-14%20at%2011.26.15.png?alt=media&#x26;token=21001435-ac16-4a3c-8e64-623481dc7cf0" alt=""><figcaption></figcaption></figure>

### Key

Copy the Key, in this example "category" and input it into the Target field of the Filter Editor.

<figure><img src="https://3250709389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS33S0eoYwMaMrLb7T_%2Fuploads%2FBSUQctQghKciOG3KkoVX%2FScreenshot%202023-08-14%20at%2011.29.18.png?alt=media&#x26;token=2ac30af0-88ff-4d01-a161-ad48bcbb5b72" alt=""><figcaption></figcaption></figure>

### Filter Type

Select the Filter Type you require in the dropdown, in this example "Button Single".

Button Single allows you to choose only one Button at a time as opposed to "Button Multiple".

<figure><img src="https://3250709389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS33S0eoYwMaMrLb7T_%2Fuploads%2FP5LZutUynzJv8K5tAKjd%2FScreenshot%202023-08-14%20at%2011.39.49.png?alt=media&#x26;token=b957dd2d-c0d9-4903-94c5-6e8338f7cdbf" alt=""><figcaption></figcaption></figure>

### Data Source

* Select required Data Source in the dropdown in the Filter Editor.
* In this example, Dynamic as we want our data to be dynamic.

![](https://3250709389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS33S0eoYwMaMrLb7T_%2Fuploads%2FfSrjx8Mdj8quO4qV9JZ7%2FScreenshot%202023-08-14%20at%2011.52.10.png?alt=media\&token=04423863-9eaf-4bdc-8b56-e044e7d3faaf)

### Data Type

* Select required Data Type, in this example Taxonomy.

![](https://3250709389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS33S0eoYwMaMrLb7T_%2Fuploads%2FmIGZRc0U1YCle5Ij9iUt%2FScreenshot%202023-08-14%20at%2011.57.17.png?alt=media\&token=a6aceded-ea2d-481f-95ff-049a118f24d5)

### Taxonomy

Choose required taxonomy type in the dropdown,  In this example want to target Categories as our Taxonomy type.

* In the Taxonomy dropdown select required taxonomy type, in this example Categories.

![](https://3250709389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS33S0eoYwMaMrLb7T_%2Fuploads%2FjqrUon0HCmBuZXP8cKeC%2FScreenshot%202023-08-14%20at%2012.02.41.png?alt=media\&token=c8392046-d86c-4995-862e-56b0017df745)

In this example we want to exclude Uncategorised posts and only include those we previously set up in the Dashboard.

* In the Taxonomy section of the Filter modal, select items to exclude in the Exclude dropdown.
* In this example, "Uncategorised".

![](https://3250709389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS33S0eoYwMaMrLb7T_%2Fuploads%2FLEA0mXlnH6ujN2aMWTni%2FScreenshot%202023-08-16%20at%2010.49.21.png?alt=media\&token=a97d2a73-45ab-4ab0-b910-86de6d106398)

In this example we do not want to display terms that do not contain any posts.

* In the Taxonomy section of the Filter modal, toggle on "Hide Empty" as required.

![](https://3250709389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS33S0eoYwMaMrLb7T_%2Fuploads%2FK31LhULgOmLAb8R8ADbr%2FScreenshot%202023-08-16%20at%2011.08.14.png?alt=media\&token=28728db0-26bf-412e-8b0c-1cf3de45b057)

## Filter categories

Now we want to be able to visualise and style the filter categories we have created.

* With the Filter block selected, add a Paragraph.

<figure><img src="https://3250709389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS33S0eoYwMaMrLb7T_%2Fuploads%2FB6RmCeZY7hkh0HdDrSIj%2FScreenshot%202023-08-16%20at%2010.58.15.png?alt=media&#x26;token=ca49e90c-7cac-431e-aa80-8ec641517372" alt=""><figcaption></figcaption></figure>

### Connect dynamic data

We need to connect our dynamic data.

* Select the Paragraph and open Dynamic Values from the toolbar.
* Select Filter as Source.

<figure><img src="https://3250709389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS33S0eoYwMaMrLb7T_%2Fuploads%2F8lO3iq6YLMMA8QFiAeBL%2FScreenshot%202023-08-16%20at%2011.18.26.png?alt=media&#x26;token=d2723fde-d208-44d4-aebe-a765bf359d98" alt=""><figcaption></figcaption></figure>

We want the Category names to appear.

* Set Filter to Name.

<figure><img src="https://3250709389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS33S0eoYwMaMrLb7T_%2Fuploads%2Fiwq2BEfFpsxd0F6EscI3%2FScreenshot%202023-08-16%20at%2011.22.25.png?alt=media&#x26;token=dc285ba6-0503-4c59-bcab-45e854885478" alt=""><figcaption></figcaption></figure>

Now you can visualise the three Categories we set up.

<figure><img src="https://3250709389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS33S0eoYwMaMrLb7T_%2Fuploads%2FtpL9J8ktNCuSBQcDpTHJ%2FScreenshot%202023-08-16%20at%2011.23.20.png?alt=media&#x26;token=83f6ff22-b9fe-41d2-87a6-d4c5dcd35d07" alt=""><figcaption></figcaption></figure>

## Layout

Let's turn our attention to the Layout of our Filter.

* In the Primary tab, open the Layout tab.
* Set Flex display, Row direction, Wrap (so that if there are multiple categories, they will display on the next line) and Align centre.

![](https://3250709389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS33S0eoYwMaMrLb7T_%2Fuploads%2FL9csn9G0m0druTfd3LIN%2FScreenshot%202023-08-16%20at%2010.55.06.png?alt=media\&token=196c1eeb-3892-4689-84ee-c12d2f4fbed0)

To add spacing around the filter items:

* Set a Row Gap and a Column gap or !8px.

<figure><img src="https://3250709389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS33S0eoYwMaMrLb7T_%2Fuploads%2F9ma6ABZXEikVuEHbBX4M%2FScreenshot%202023-08-16%20at%2011.28.29.png?alt=media&#x26;token=9ed9c443-98ff-4f34-b2f0-27117042cc39" alt=""><figcaption></figcaption></figure>

To Space the Filter items from the Query:

* In the Margin and Padding tab, set a bottom Margin of 50px.

<figure><img src="https://3250709389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS33S0eoYwMaMrLb7T_%2Fuploads%2FW1IRPgiL4Ow7TbqZntPN%2FScreenshot%202023-08-16%20at%2011.30.26.png?alt=media&#x26;token=ec2735a7-4486-4360-a0ff-9200e057ffca" alt=""><figcaption></figcaption></figure>

## Style

Now we need to Style the Filter Titles.

* In the Typography tab of the Primary tab, set an appropriate font size and weight.

<figure><img src="https://3250709389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS33S0eoYwMaMrLb7T_%2Fuploads%2FhBdTDNz6HU9O0JafLono%2FScreenshot%202023-08-16%20at%2011.34.56.png?alt=media&#x26;token=e149f260-2114-4397-92a6-ab7aad9a8a97" alt=""><figcaption></figcaption></figure>

* In the Design tab, open the Borders tab and the Radius and Border tab.
* Set a 40px equal Radius or as required to give a suitable oval look.
* Set an appropriate Border colour, in this example dark grey.
* Set a solid border Style with an equal 1px Width.

<figure><img src="https://3250709389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS33S0eoYwMaMrLb7T_%2Fuploads%2FYX1gflVPEUALz53Hf4Ae%2FScreenshot%202023-08-16%20at%2011.37.59.png?alt=media&#x26;token=ba665949-9417-49b5-bbc8-e35abbe7930e" alt=""><figcaption></figcaption></figure>

Set an appropriate Padding to allow the items to breathe.

* In the Design tab, open the Margin and Padding tab and set an upper and lower 10px Padding and a 30px right and left Padding or as required.

<figure><img src="https://3250709389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS33S0eoYwMaMrLb7T_%2Fuploads%2FLJ4MNylmPyFv6JssTqwg%2FScreenshot%202023-08-16%20at%2011.41.00.png?alt=media&#x26;token=705fdf21-7a1d-4f60-b3f3-39a7ab111960" alt=""><figcaption></figcaption></figure>

## Relative Styling for button selection

Now we have fully set up the Filter buttons but to make it easier for the User, we can add a colour  change to the current button to let them know what category is selected.

* With the Filter block selected, open the Design tab and the Relative Styling tab.
* Click the "+" icon to add a new Relative Style.

<figure><img src="https://3250709389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS33S0eoYwMaMrLb7T_%2Fuploads%2FLzexXZKotHmq8rRCdcby%2FScreenshot%202023-08-16%20at%2011.47.17.png?alt=media&#x26;token=bf0e0080-889c-4c16-92dc-c9b428283c80" alt=""><figcaption></figcaption></figure>

We need to set the Rules under which this change will occur.

* Click the "Rules" icon to open the Relative Styles Rules modal.
* Input a suitable Name, in this example "Selected".

<figure><img src="https://3250709389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS33S0eoYwMaMrLb7T_%2Fuploads%2FDiuKnmSLfS9TkbTHxYdC%2FScreenshot%202023-08-16%20at%2011.51.39.png?alt=media&#x26;token=bd475cb2-a7d9-467d-b643-f9d8ae090d81" alt=""><figcaption></figcaption></figure>

* In  "Rules after block class" set Combinator to "Descendent".

<figure><img src="https://3250709389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS33S0eoYwMaMrLb7T_%2Fuploads%2F65E1jYa3Gzccz5aFFERs%2FScreenshot%202023-08-16%20at%2011.55.20.png?alt=media&#x26;token=5a540d05-3698-4336-8172-16afa5f362e0" alt=""><figcaption></figcaption></figure>

* Set Type to Class.

<figure><img src="https://3250709389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS33S0eoYwMaMrLb7T_%2Fuploads%2F1zOVZMw447oyWyBNC3Dm%2FScreenshot%202023-08-16%20at%2011.56.34.png?alt=media&#x26;token=e5f660f1-c425-42da-ae26-739b3fac0b64" alt=""><figcaption></figcaption></figure>

* Input "selected" as Selector since we wish the rule to apply to the selected filter item.
* Click Create "selected" to create.

<figure><img src="https://3250709389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS33S0eoYwMaMrLb7T_%2Fuploads%2FGDDgR014nIWm4lybsyoh%2FScreenshot%202023-08-16%20at%2011.58.56.png?alt=media&#x26;token=d7300e44-7ee7-40b0-948d-911742f7c198" alt=""><figcaption></figcaption></figure>

We want to add another Rule to target the selected paragraph.

* Click the "+" icon in  Rules after block class.

<figure><img src="https://3250709389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS33S0eoYwMaMrLb7T_%2Fuploads%2FQL7NsBbE58exZsY2mwlo%2FScreenshot%202023-08-16%20at%2011.59.44.png?alt=media&#x26;token=0c7f106e-ab38-44b6-a5d2-c9381ab523dd" alt=""><figcaption></figcaption></figure>

* Set Combinator to Descendant.

<figure><img src="https://3250709389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS33S0eoYwMaMrLb7T_%2Fuploads%2FS4ghcKp9tEVk7LFYnnDr%2FScreenshot%202023-08-16%20at%2012.00.47.png?alt=media&#x26;token=12d7285b-b172-43f8-9fb9-f141b895ef7f" alt=""><figcaption></figcaption></figure>

* Set Type to Class.

<figure><img src="https://3250709389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS33S0eoYwMaMrLb7T_%2Fuploads%2FWedzDUArKxwCzeIIGyEc%2FScreenshot%202023-08-16%20at%2012.02.05.png?alt=media&#x26;token=edc98f68-d41e-4722-938e-81a5c65a54cb" alt=""><figcaption></figcaption></figure>

* In the Navigator, right click on the Paragraph block contained inside the Filter block and copy the Class.

<figure><img src="https://3250709389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS33S0eoYwMaMrLb7T_%2Fuploads%2Fq4fa0q4qxMFXdynCGaWm%2FScreenshot%202023-08-16%20at%2012.02.48.png?alt=media&#x26;token=54720159-c7e0-4514-b7e1-fb78a54a7a62" alt=""><figcaption></figcaption></figure>

* Paste the copied paragraph class into the Selector field.

<figure><img src="https://3250709389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS33S0eoYwMaMrLb7T_%2Fuploads%2FjBkCItPq1Nw0CSbInnls%2FScreenshot%202023-08-16%20at%2012.07.29.png?alt=media&#x26;token=948048c6-a2f1-4374-924a-efeace6c70da" alt=""><figcaption></figcaption></figure>

It's time to style the relative styling we set up.

* In the Design tab, open the Relative styling tab.
* Click the required Relative Style you wish to customise, in this example "Selected".

![](https://3250709389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS33S0eoYwMaMrLb7T_%2Fuploads%2FGRVmVY2FNd5R3CnPklU4%2FScreenshot%202023-08-17%20at%2010.48.51.png?alt=media\&token=74d99a07-3864-4556-ba21-4fabd5e21fc1)

In this example we want the white background to become black when selected.

* In the Background tab, open the colours tab and choose a suitable background colour, in this example Black.

![](https://3250709389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS33S0eoYwMaMrLb7T_%2Fuploads%2FmfP9JkhEDMnjrXpLjQvv%2FScreenshot%202023-08-17%20at%2010.50.52.png?alt=media\&token=d910c287-8f3a-4310-b86f-ac154066847c)

Let's style the text. In this example we want the text to change white when selected.

* In the Typography tab, select a suitable Text colour, in this example white.

![](https://3250709389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS33S0eoYwMaMrLb7T_%2Fuploads%2Fmke402Q0Bsxm8kzCKG01%2FScreenshot%202023-08-17%20at%2010.52.16.png?alt=media\&token=c689b85a-10de-43ea-8222-138b47131261)

Now when a user selects a filter button, the background will turn black and the text white.

<figure><img src="https://3250709389-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MS33S0eoYwMaMrLb7T_%2Fuploads%2FjlQbjv0QEUxeHZ26zKcr%2FScreenshot%202023-08-17%20at%2010.54.46.png?alt=media&#x26;token=1179f99c-e712-467a-acbd-0097b854f680" alt=""><figcaption></figcaption></figure>
