Skip to content
Likable Aurora @likable-hair/svelte 5

Filters

Filter bar for lists and tables. The app declares the filterable fields (text, number, date, options, yes/no or its own input; columns, joins, relations and custom queries are declared on the field), and the user adds the conditions one at a time: "Add filter" lists the fields (with a search when they are many), then a card asks for the operator of that field and the value. Each condition becomes a pill "field · operator · value": click it to edit, its × removes it. The "Filters" button shows how many conditions are active and opens a panel with every condition in rows ("Where … and …"), where allowOr lets the user switch to OR and maxDepth allows nested groups. pinned fields are always in the bar, and presets are chips that add ready-made conditions. Changes apply as soon as a condition is complete (after applyDelay); with confirm the card and the panel have Cancel and Apply. On screens up to 1024px wide the panel opens in a bottom sheet (mobileDrawer); when the bar is narrower than 640px (a phone, a side column) it is compact: the pills and "Clear" stay on one row that scrolls sideways, "Add filter" lives only in the panel or the sheet opened by "Filters", and next to a prependSnippet (for example a search) "Filters" shows only its icon and the count (data-compact). The conditions live in value, a plain JSON tree (see createFilters), and onchange receives it with the FilterBuilder of the query, built by filtersToBuilder. Every text can be translated with labels.

import { Filters } from '@likable-hair/svelte';

src/lib/components/composed/search/Filters.svelte · Markdown for LLMs

Add filters one at a time

"Add filter" lists the fields, then the card asks for the operator and the value; each condition becomes a pill (click to edit, × to remove). The "Filters" button opens every condition in rows. Below, the query that onchange receives (builder.toJson()).

"Change a filter to see the query"
Code
<script lang="ts">
	import { Filters, createFilters, filterCondition, type FilterBuilder } from '@likable-hair/svelte';
	import { fields } from './fields.js';

	let value = $state(
		createFilters([
			filterCondition('service', 'in', [{ value: 3, label: 'Balayage' }]),
			filterCondition('amount', 'gte', 50)
		])
	);
	let query = $state<FilterBuilder>();
</script>

<div class="example">
	<Filters {fields} bind:value onchange={(change) => (query = change.builder)} />
	<pre>{JSON.stringify(query?.toJson() ?? 'Change a filter to see the query', null, 2)}</pre>
</div>

<style>
	.example {
		display: grid;
		gap: 16px;
	}

	pre {
		max-height: 220px;
		margin: 0;
		overflow: auto;
		padding: 12px;
		border-radius: var(--global-radius-md);
		background: var(--global-color-surface-2);
		color: var(--global-color-text-2);
		font-size: 11.5px;
	}
</style>

AND, OR and nested groups

allowOr lets the user switch the conditions to OR (on the second row), maxDepth allows groups: every filter is a box with "Add nested filter", which turns it into a group (OR under AND when allowOr is on) or adds a row to it, and the root has one "Add filter". Turn them on only when the backend applies OR groups correctly.

Code
<script lang="ts">
	import { Filters, createFilters, filterCondition, filterGroup } from '@likable-hair/svelte';
	import { fields } from './fields.js';

	let value = $state(
		createFilters([
			filterCondition('date', 'period', 'thisMonth'),
			filterGroup('or', [
				filterCondition('status', 'in', [{ value: 'waiting', label: 'Waiting' }]),
				filterCondition('paid', 'isFalse')
			])
		])
	);
</script>

<Filters {fields} bind:value allowOr maxDepth={1} />

Pinned fields, presets and actions

pinned keeps a field in the bar even without a condition; presets are chips that add ready-made conditions; actionsSnippet puts the page actions on the right. A hidden field with a locked condition is a fixed constraint the user does not see.

Code
<script lang="ts">
	import { mdiPlus } from '@mdi/js';
	import { Button, Filters, createFilters, filterCondition, type FilterField, type FilterPreset } from '@likable-hair/svelte';
	import { fields as base } from './fields.js';

	const fields: FilterField[] = [
		...base.map((field) => (field.name === 'status' ? { ...field, pinned: true } : field)),
		{ name: 'tenant', label: 'Salon', type: 'number', column: 'appointments.salonId', hidden: true }
	];

	const presets: FilterPreset[] = [
		{ id: 'today', label: 'Today', count: 18, conditions: [{ field: 'date', operator: 'period', value: 'today' }] },
		{ id: 'week', label: 'This week', count: 94, conditions: [{ field: 'date', operator: 'period', value: 'thisWeek' }] },
		{ id: 'unpaid', label: 'Not paid', count: 7, conditions: [{ field: 'paid', operator: 'isFalse' }] }
	];

	let value = $state(createFilters([filterCondition('tenant', 'eq', 12, { locked: true })]));
</script>

<Filters {fields} {presets} bind:value>
	{#snippet actionsSnippet()}
		<Button size="sm" icon={mdiPlus}>New appointment</Button>
	{/snippet}
</Filters>

Confirm before applying, in Italian

With confirm the card and the panel work on a draft with Cancel and Apply, as in v4. locale="it" is enough for Italian: it picks every text of the library (operators, periods, placeholders, the lists and the calendar included) and the format of dates and numbers; labels changes only the texts you pass. The field labels are the app's own.

Code
<script lang="ts">
	import { Filters, createFilters } from '@likable-hair/svelte';
	import { italianFields } from './fields.js';

	let value = $state(createFilters());
</script>

<Filters fields={italianFields} bind:value confirm locale="it" />

Playground: every field, operator and option

One field for each type and option (several columns and words, suggestions, case sensitivity, units and scale, column comparisons, date only, date and time, periods and relative dates, options from a list, a search, countries, toggles, a Postgres array, a relation through a subquery, JSONB keys, nullable and computed yes/no, a hidden constraint), with OR and nested groups (pick how deep with maxDepth, 2 by default), presets, saved filters (kept in this browser) and a pinned field. Below: the query of filtersToBuilder, the URL parameter of filtersToParam and every operator of every type.

Query (filtersToBuilder(value, fields).toJson())
{
  "modifiers": [
    {
      "method": "where",
      "kind": "simple",
      "key": "appointments.salonId",
      "operator": "=",
      "value": 12,
      "logicalOperator": "and"
    },
    {
      "method": "where",
      "kind": "grouped",
      "logicalOperator": "and",
      "children": [
        {
          "method": "where",
          "kind": "simple",
          "key": "clients.firstName",
          "operator": "ilike",
          "value": "%mario%",
          "logicalOperator": "and"
        },
        {
          "method": "where",
          "kind": "simple",
          "key": "clients.lastName",
          "operator": "ilike",
          "value": "%mario%",
          "logicalOperator": "or"
        }
      ]
    },
    {
      "method": "where",
      "kind": "grouped",
      "logicalOperator": "and",
      "children": [
        {
          "method": "where",
          "kind": "simple",
          "key": "clients.firstName",
          "operator": "ilike",
          "value": "%rossi%",
          "logicalOperator": "and"
        },
        {
          "method": "where",
          "kind": "simple",
          "key": "clients.lastName",
          "operator": "ilike",
          "value": "%rossi%",
          "logicalOperator": "or"
        }
      ]
    },
    {
      "method": "where",
      "kind": "simple",
      "key": "appointments.amount",
      "operator": ">=",
      "value": 50,
      "logicalOperator": "and"
    },
    {
      "method": "where",
      "kind": "simple",
      "key": "appointments.amount",
      "operator": "<=",
      "value": 200,
      "logicalOperator": "and"
    },
    {
      "method": "where",
      "kind": "grouped",
      "logicalOperator": "and",
      "children": [
        {
          "method": "where",
          "kind": "grouped",
          "logicalOperator": "and",
          "children": [
            {
              "method": "where",
              "kind": "simple",
              "key": "appointments.startsAt",
              "operator": ">=",
              "value": "2026-09-10T00:00:00.000Z",
              "logicalOperator": "and"
            },
            {
              "method": "where",
              "kind": "simple",
              "key": "appointments.startsAt",
              "operator": "<=",
              "value": "2026-09-24T23:59:59.999Z",
              "logicalOperator": "and"
            }
          ]
        },
        {
          "method": "where",
          "kind": "simple",
          "key": "clients.labels",
          "operator": "@>",
          "value": [
            "vip",
            "new"
          ],
          "logicalOperator": "or"
        }
      ]
    },
    {
      "method": "where",
      "kind": "simple",
      "key": "clients.archived",
      "operator": "=",
      "value": false,
      "logicalOperator": "and"
    }
  ]
}
URL parameter (filtersToParam(value))
{"logic":"and","items":[{"field":"salon","operator":"eq","value":12,"locked":true},{"field":"client","operator":"contains","value":"mario rossi"},{"field":"amount","operator":"between","value":{"from":50,"to":200}},{"logic":"or","items":[{"field":"date","operator":"inLast","value":{"amount":2,"unit":"weeks"}},{"field":"labels","operator":"all","value":[{"value":"vip","label":"VIP"},{"value":"new","label":"New"}]}]}]}
Every operator of every type
TypeOperatorLabelInput
stringcontainscontainstext
stringnotContainsdoesn't containtext
stringisistext
stringisNotis nottext
stringstartsWithstarts withtext
stringendsWithends withtext
stringanyOfis any oftexts
stringnoneOfis none oftexts
stringmatchissuggest
stringemptyis emptynone
stringnotEmptyis not emptynone
stringlikeliketext
stringilikeliketext
numbereq=number
numberne≠number
numbergt>number
numbergte≥number
numberlt<number
numberlte≤number
numberbetweenbetweennumberRange
numbernotBetweennot betweennumberRange
numberanyOfis any ofnumbers
numbernoneOfis none ofnumbers
numbercolumnEq= columncolumn
numbercolumnNe≠ columncolumn
numbercolumnGt> columncolumn
numbercolumnGte≥ columncolumn
numbercolumnLt< columncolumn
numbercolumnLte≤ columncolumn
numberemptyis emptynone
numbernotEmptyis not emptynone
dateisisdate
dateisNotis notdate
datebeforebeforedate
dateafterafterdate
dateonOrBeforeon or beforedate
dateonOrAfteron or afterdate
datebetweenbetweendateRange
datenotBetweennot betweendateRange
dateperiodinperiod
dateinLastin the lastrelative
dateinNextin the nextrelative
dateolderThanmore than … agorelative
datelaterThanmore than … aheadrelative
datecolumnEq= columncolumn
datecolumnNe≠ columncolumn
datecolumnGt> columncolumn
datecolumnGte≥ columncolumn
datecolumnLt< columncolumn
datecolumnLte≤ columncolumn
dateemptyis emptynone
datenotEmptyis not emptynone
selectinisitems
selectnotInis notitems
selectallhas all ofitems
selectemptyis emptynone
selectnotEmptyis not emptynone
boolisTrueisnone
boolisFalseisnone
boolemptyis emptynone
boolnotEmptyis not emptynone
customcustomcustom
Code
<script lang="ts">
	import {
		mdiAccountOutline,
		mdiBarcode,
		mdiCalendarClock,
		mdiCalendarOutline,
		mdiCashMultiple,
		mdiCheckCircleOutline,
		mdiContentCut,
		mdiEarth,
		mdiPackageVariant,
		mdiPalette,
		mdiStar,
		mdiTagOutline,
		mdiWeight
	} from '@mdi/js';
	import {
		DEFAULT_FILTER_LABELS,
		FILTER_OPERATORS,
		Filters,
		Select,
		createFilters,
		filterCondition,
		filterGroup,
		filtersToBuilder,
		filtersToParam,
		type FilterField,
		type FilterItem,
		type FilterPreset
	} from '@likable-hair/svelte';

	const staff: FilterItem[] = [
		{ value: 1, label: 'Giulia Marini' },
		{ value: 2, label: 'Luca Rossi' },
		{ value: 3, label: 'Sara Bianchi' },
		{ value: 4, label: 'Marta Neri' }
	];
	const products: FilterItem[] = [
		{ value: 'P-100', label: 'P-100 Nourishing shampoo' },
		{ value: 'P-140', label: 'P-140 Keratin mask' },
		{ value: 'P-220', label: 'P-220 Argan oil' }
	];

	const wait = (signal: AbortSignal) =>
		new Promise<void>((resolve, reject) => {
			const timer = setTimeout(resolve, 300);
			signal.addEventListener('abort', () => {
				clearTimeout(timer);
				reject(signal.reason);
			});
		});

	const fields: FilterField[] = [
		{
			name: 'client',
			label: 'Client',
			icon: mdiAccountOutline,
			type: 'string',
			columns: ['clients.firstName', 'clients.lastName'],
			words: true,
			category: 'Text'
		},
		{
			name: 'product',
			label: 'Product',
			icon: mdiBarcode,
			type: 'string',
			column: 'products.name',
			suggestColumn: 'products.code',
			suggest: async ({ searchText, signal }) => {
				await wait(signal);
				return products.filter((item) => String(item.label).toLowerCase().includes(searchText.toLowerCase()));
			},
			category: 'Text'
		},
		{
			name: 'code',
			label: 'Code (case sensitive)',
			type: 'string',
			column: 'appointments.code',
			caseSensitive: true,
			category: 'Text'
		},
		{
			name: 'amount',
			label: 'Amount',
			icon: mdiCashMultiple,
			type: 'number',
			unit: '€',
			column: 'appointments.amount',
			compareWith: [{ column: 'appointments.deposit', label: 'Deposit' }],
			category: 'Numbers'
		},
		{
			name: 'weight',
			label: 'Weight',
			icon: mdiWeight,
			type: 'number',
			unit: 't',
			scale: 1000,
			column: 'goods.weightKg',
			category: 'Numbers'
		},
		{
			name: 'date',
			label: 'Date',
			icon: mdiCalendarOutline,
			type: 'date',
			column: 'appointments.startsAt',
			category: 'Dates'
		},
		{
			name: 'due',
			label: 'Due day (date only)',
			icon: mdiCalendarOutline,
			type: 'date',
			dateOnly: true,
			column: 'invoices.dueDate',
			category: 'Dates'
		},
		{
			name: 'delivered',
			label: 'Delivered at (date and time)',
			icon: mdiCalendarClock,
			type: 'date',
			withTime: true,
			column: 'orders.deliveredAt',
			compareWith: [{ column: 'orders.promisedAt', label: 'Promised at' }],
			category: 'Dates'
		},
		{
			name: 'service',
			label: 'Service',
			icon: mdiContentCut,
			type: 'select',
			column: 'appointments.serviceId',
			items: [
				{ value: 1, label: 'Cut' },
				{ value: 2, label: 'Color' },
				{ value: 3, label: 'Balayage' },
				{ value: 'care', label: 'Any treatment', values: [4, 5, 6] }
			],
			category: 'Options'
		},
		{
			name: 'status',
			label: 'Status',
			icon: mdiCheckCircleOutline,
			type: 'select',
			view: 'toggle',
			pinned: true,
			column: 'appointments.status',
			items: [
				{ value: 'confirmed', label: 'Confirmed' },
				{ value: 'waiting', label: 'Waiting' },
				{ value: 'cancelled', label: 'Cancelled' }
			],
			category: 'Options'
		},
		{
			name: 'staff',
			label: 'Staff (search)',
			icon: mdiAccountOutline,
			type: 'select',
			column: 'appointments.staffId',
			shortcuts: [{ value: 1, label: 'Me' }],
			searcher: async ({ searchText, signal }) => {
				await wait(signal);
				return staff.filter((item) => String(item.label).toLowerCase().includes(searchText.toLowerCase()));
			},
			category: 'Options'
		},
		{
			name: 'country',
			label: 'Country',
			icon: mdiEarth,
			type: 'select',
			view: 'countries',
			column: 'clients.country',
			category: 'Options'
		},
		{
			name: 'labels',
			label: 'Labels (Postgres array)',
			icon: mdiTagOutline,
			type: 'select',
			array: true,
			column: 'clients.labels',
			items: [
				{ value: 'vip', label: 'VIP' },
				{ value: 'allergic', label: 'Allergic' },
				{ value: 'new', label: 'New' }
			],
			category: 'Options'
		},
		{
			name: 'tags',
			label: 'Tags (relation)',
			icon: mdiTagOutline,
			type: 'select',
			column: 'tagId',
			through: { key: 'clients.id', from: 'client_tags', select: 'clientId' },
			items: [
				{ value: 1, label: 'Student' },
				{ value: 2, label: 'Bride' },
				{ value: 3, label: 'Partner' }
			],
			category: 'Options'
		},
		{
			name: 'color',
			label: 'Favourite color (JSONB)',
			icon: mdiPalette,
			type: 'select',
			json: { column: 'clients.customFields', key: 'color' },
			items: [
				{ value: 'red', label: 'Red' },
				{ value: 'blonde', label: 'Blonde' },
				{ value: 'brown', label: 'Brown' }
			],
			category: 'JSON'
		},
		{
			name: 'visits',
			label: 'Visits (JSONB number)',
			type: 'number',
			json: { column: 'clients.customFields', key: 'stats.visits', cast: 'numeric' },
			category: 'JSON'
		},
		{ name: 'paid', label: 'Paid', icon: mdiCashMultiple, type: 'bool', column: 'appointments.paid', category: 'Yes / no' },
		{
			name: 'vip',
			label: 'VIP (nullable)',
			icon: mdiStar,
			type: 'bool',
			nullable: true,
			column: 'clients.vip',
			category: 'Yes / no'
		},
		{
			name: 'lowStock',
			label: 'Low stock',
			icon: mdiPackageVariant,
			type: 'bool',
			trueLabel: 'Below minimum',
			falseLabel: 'Enough',
			whenTrue: (builder) => builder.whereColumn('products.quantity', '<', 'products.minQuantity'),
			whenFalse: (builder) => builder.whereColumn('products.quantity', '>=', 'products.minQuantity'),
			category: 'Yes / no'
		},
		{
			name: 'archived',
			label: 'Show archived',
			type: 'bool',
			operators: ['isTrue'],
			whenTrue: () => {},
			whenAbsent: (builder) => builder.where('clients.archived', '=', false),
			category: 'Yes / no'
		},
		{ name: 'salon', label: 'Salon', type: 'number', column: 'appointments.salonId', hidden: true }
	];

	const presets: FilterPreset[] = [
		{ id: 'today', label: 'Today', count: 18, conditions: [{ field: 'date', operator: 'period', value: 'today' }] },
		{ id: 'week', label: 'This week', count: 94, conditions: [{ field: 'date', operator: 'period', value: 'thisWeek' }] },
		{ id: 'unpaid', label: 'Not paid', count: 7, conditions: [{ field: 'paid', operator: 'isFalse' }] }
	];

	const now = new Date(2026, 8, 24, 10);
	let maxDepth = $state(2);

	let value = $state(
		createFilters([
			filterCondition('salon', 'eq', 12, { locked: true }),
			filterCondition('client', 'contains', 'mario rossi'),
			filterCondition('amount', 'between', { from: 50, to: 200 }),
			filterGroup('or', [
				filterCondition('date', 'inLast', { amount: 2, unit: 'weeks' }),
				filterCondition('labels', 'all', [
					{ value: 'vip', label: 'VIP' },
					{ value: 'new', label: 'New' }
				])
			])
		])
	);
	let query = $derived(JSON.stringify(filtersToBuilder(value, fields, { now }).toJson(), null, 2));
	let param = $derived(filtersToParam(value));
	let types = Object.entries(FILTER_OPERATORS);
</script>

<div class="example">
	<div class="depth">
		<Select
			label="maxDepth"
			items={[0, 1, 2, 3].map((depth) => ({ value: depth, label: String(depth) }))}
			bind:value={maxDepth}
		/>
	</div>
	<Filters {fields} bind:value {presets} allowOr {maxDepth} operatorSet="all" savedKey="aurora-docs-playground" />
	<details open>
		<summary>Query (<code>filtersToBuilder(value, fields).toJson()</code>)</summary>
		<pre>{query}</pre>
	</details>
	<details>
		<summary>URL parameter (<code>filtersToParam(value)</code>)</summary>
		<pre>{param}</pre>
	</details>
	<details>
		<summary>Every operator of every type</summary>
		<table>
			<thead><tr><th>Type</th><th>Operator</th><th>Label</th><th>Input</th></tr></thead>
			<tbody>
				{#each types as [type, list] (type)}
					{#each list as operator (operator.name)}
						<tr>
							<td>{type}</td>
							<td><code>{operator.name}</code></td>
							<td>{DEFAULT_FILTER_LABELS.operators[operator.name] ?? ''}</td>
							<td>{operator.input}</td>
						</tr>
					{/each}
				{/each}
			</tbody>
		</table>
	</details>
</div>

<style>
	.example {
		display: grid;
		gap: 14px;
	}

	.depth {
		width: 120px;
	}

	details {
		border: var(--global-border-width) solid var(--global-color-border);
		border-radius: var(--global-radius-md);
		padding: 8px 12px;
		background: var(--global-color-surface);
	}

	summary {
		color: var(--global-color-text-2);
		font-size: 13px;
		cursor: pointer;
	}

	pre {
		max-height: 260px;
		margin: 10px 0 0;
		overflow: auto;
		color: var(--global-color-text-2);
		font-size: 11.5px;
		white-space: pre-wrap;
		word-break: break-all;
	}

	table {
		width: 100%;
		margin-top: 10px;
		border-collapse: collapse;
		font-size: 12.5px;
	}

	th,
	td {
		padding: 4px 8px;
		border-bottom: var(--global-border-width) solid var(--global-color-border);
		text-align: start;
	}

	th {
		color: var(--global-color-text-3);
		font-weight: 600;
	}
</style>

Fewer operators for simple apps

operatorSet decides how many operators the fields offer: basic (the essential ones), standard (default) or all. typeOperators sets an own list for a type, and a field's operators wins over both (a list, or a set name). With one operator the card shows no choice at all.

Code
<script lang="ts">
	import { Filters, createFilters } from '@likable-hair/svelte';
	import { fields } from './fields.js';

	let value = $state(createFilters());
</script>

<Filters
	{fields}
	bind:value
	operatorSet="basic"
	typeOperators={{ date: ['is', 'period'] }}
/>

Props

NameTypeDefaultDescription
fields requiredFilterField[]The fields the user can filter.
value bindable FilterGroupThe conditions: a tree of groups and conditions (see createFilters). Without it the component keeps its own; to clear them from the app pass createFilters().
allowOr booleanfalseLets the user combine the conditions with OR instead of AND. Turn it on only when the backend applies OR groups correctly.
maxDepth number0How deep groups can be nested in the panel: 0 means no groups. With GET requests most backends read one level.
confirm booleanfalseThe card and the panel work on a draft, with Cancel and Apply. Without it every complete change applies.
applyDelay number300Milliseconds between the last change and onchange (without confirm).
operatorSet 'basic' | 'standard' | 'all''standard'Operators the fields without operators offer: basic (the essential ones), standard (default) or all.
typeOperators Partial<Record<'string' | 'number' | 'date' | 'select' | 'bool' | 'custom', string[]>>Own operator list per field type for the fields without operators, instead of operatorSet (for example { date: ['is', 'between', 'period'] }).
presets FilterPreset[][]Ready-made sets of conditions, shown as chips under the bar.
savable booleanfalseShows "Saved filters": the user saves the current filters under a name and applies them later. On with saved or savedKey too.
saved bindable SavedFilter[]The saved filters. Bind it (or use onsavedchange) to keep them in the backend.
savedKey stringKeeps the saved filters in the browser (localStorage) under this key.
builder FilterBuilderQuery the filters are added to in onchange (for example with the search and the sorting).
locale stringBCP 47 locale: the language of every text (it and en are built in, others fall back to English) and the format of dates and numbers. Defaults to the one set with setDefaultLocale, else en.
weekStart 0 | 1 | 2 | 3 | 4 | 5 | 61First day of the week for the periods thisWeek, lastWeek and nextWeek. Default 1 (Monday).
negativesIncludeEmpty booleantrueNegative operators ("is not", "does not contain", ≠, "is none of", "not between") also keep the rows where the field is empty, which SQL leaves out. On by default; it sends null modifiers, so pass false for backends that do not know them (variants E and E'). A field's negativesIncludeEmpty wins.
labels FilterLabelsInputTexts to change (see FilterLabels), on top of those of locale: pass only what differs, or every text for a language the library does not have.
showPills booleantrueShows a pill for each condition in the bar.
mobileDrawer booleantrueOn screens up to 1024px wide, every editor opens in a bottom sheet with all the conditions.
class { container?: string; bar?: string; pill?: string; panel?: string }{}Extra classes for each part.

Snippets

NameParametersDescription
prependSnippetContent at the start of the bar (for example a search field).
appendSnippetContent after the filter buttons.
actionsSnippetContent at the end of the bar, pushed to the right (for example "New" or "Export").
pillSnippet{ condition: FilterCondition; field: FilterField; operator: string; value: string }Replaces the text of a pill (field, operator and value). The pill keeps its buttons.
inputSnippet{ field: FilterField; operator: string; value: unknown; setValue: (value: unknown) => void }Input of the value for custom fields and operators with input: 'custom'. Call setValue with the new value.

Events

NameTypeDescription
onchange(change: { value: FilterGroup; builder: FilterBuilder }) => voidCalled when the query changes: the tree (complete conditions only) and the FilterBuilder built from it.
onremove(change: { conditions: FilterCondition[] }) => voidCalled when the user removes complete conditions (× of a pill, Remove, Clear, a row of the panel, a preset turned off), for example to reset state of the app.
onsavedchange(saved: SavedFilter[]) => voidCalled when the user saves or deletes saved filters, with the new list.
onopen(event: { view: 'fields' | 'editor' | 'panel'; field?: FilterField }) => voidCalled when the list of fields, a card or the panel opens, for example to load the options of a field.

Types

Exported by the package: import type { FilterField, FilterGroup, FilterPreset, SavedFilter, FilterLabelsInput, FilterCondition, StringFilterField, NumberFilterField, DateFilterField, SelectFilterField, BoolFilterField, CustomFilterField, FilterLogic, FilterNode, FilterLabels, FilterPeriod, FilterTimeUnit, FilterConditionValue, FilterJoin, FilterThrough, FilterOperatorDefinition, FilterOperatorSet, FilterItem, FilterInput, Item } from '@likable-hair/svelte';

FilterField

A filterable field: what the app declares for each column the user can filter.

type FilterField = StringFilterField | NumberFilterField | DateFilterField | SelectFilterField | BoolFilterField | CustomFilterField

FilterGroup

A group of conditions and groups, combined with logic. The root of the tree is a group.

interface FilterGroup

NameTypeDescription
id requiredstringIdentity inside the tree, made by the helpers.
logic requiredFilterLogicand: every item must hold; or: at least one.
items requiredFilterNode[]Conditions and nested groups.
locked booleanThe user cannot change or remove the group.

FilterPreset

A ready-made set of conditions shown as a chip that the user turns on and off ("Today · 18").

interface FilterPreset

NameTypeDescription
id requiredstringIdentity of the preset, stored in the conditions it adds.
label requiredstringText of the chip.
icon stringSVG path of an icon in the chip.
count number | stringNumber shown after the label (for example the matching rows).
conditions requiredOmit<FilterCondition, 'id' | 'preset'>[]Conditions added when the chip is turned on.

SavedFilter

A set of filters saved by the user under a name (see Filters savable).

interface SavedFilter

NameTypeDescription
id requiredstringIdentity of the saved filters.
name requiredstringName chosen by the user.
value requiredFilterGroupThe saved tree.

FilterLabelsInput

Texts to change: any of FilterLabels, with operators, periods and units partial too.

type FilterLabelsInput = Partial<Omit<FilterLabels, 'operators' | 'periods' | 'units'>> & { … }

NameTypeDescription
operators Partial<Record<string, string>>
periods Partial<Record<FilterPeriod, string>>
units Partial<Record<FilterTimeUnit, string>>

FilterCondition

A condition of the tree: a field, an operator and a value.

interface FilterCondition

NameTypeDescription
id requiredstringIdentity inside the tree, made by the helpers. Not shown anywhere.
field requiredstringname of the field.
operator requiredstringName of the operator, one of the field's.
value FilterConditionValueValue for the operator.
locked booleanThe user sees the condition but cannot change or remove it.
preset stringid of the preset that added the condition: the preset chip is on while its conditions are in the tree.

StringFilterField

A text field.

interface StringFilterField extends FieldBase

NameTypeDescription
name requiredstringIdentity of the field, stored in the conditions.
label requiredstringName shown to the user.
icon stringSVG path of an icon shown in the list, the card and the pill.
category stringGroups the fields in the list of "Add filter".
description stringSecondary text in the list of fields.
column stringColumn of the query. Defaults to name.
joins FilterJoin[]Joins added to the query when the field has a condition.
through FilterThrough | FilterThrough[]The condition is checked in a subquery on a related table (column is a column of the last hop). Several hops nest.
operators FilterOperatorSet | (string | FilterOperatorDefinition)[]Operators offered, in this order: names of the built-in ones of the type, definitions of new ones, or a whole set (basic, standard, all). Defaults to the set chosen on Filters (standard).
defaultOperator stringOperator of a new condition. Defaults to the first one.
pinned booleanAlways shown as a pill in the bar, even without a condition.
hidden booleanNever shown: its conditions (usually locked) only reach the query.
defaultValue FilterConditionValueValue of a new condition on this field (the card and the panel start with it).
isComplete (condition: FilterCondition) => booleanDecides when a condition on this field is complete (it reaches the query and gets a pill). Defaults to a check on the value for the operator.
apply (builder: FilterBuilder, condition: FilterCondition) => voidReplaces the whole query of a condition on this field.
whenAbsent (builder: FilterBuilder) => voidQuery added when the field has no condition at all (for example "hide archived" until the user asks for them).
format (condition: FilterCondition) => stringReplaces the text of the value in the pill.
negativesIncludeEmpty booleanNegative operators (isNot, notContains, ne, notIn, noneOf, notBetween) also keep the rows where the column is empty: "surname is not Rossi" shows the clients without a surname too. On by default (option of Filters / filtersToBuilder); this one wins. Needs a backend that knows null modifiers: pass false for backends E and E'.
json { column: string; key: string; cast?: 'text' | 'numeric' | 'date' | 'timestamp' | 'boolean' }The value lives in a key of a JSONB column (customFields.color): equalities use whereJsonSuperset; with cast every operator works through a parametrized whereRaw (accepted only by backends that allow raw conditions).
type required'string'
columns string[]Several columns: a condition holds when any of them matches (contains), or when none does (isNot, notContains).
words booleanSplits the text into words, for names split over columns: contains wants every word in some column; is wants every word as a whole word of some column, ignoring case unless caseSensitive ("mario rossi" finds Mario Rossi, Rossi Mario and Maria Grazia De Rossi with "maria rossi", not Mariolina Rossini); notContains and isNot are their exact opposites (some word is missing). The other operators compare the whole text.
caseSensitive booleanTells upper and lower case apart. Without it every text operator ignores case: contains with ilike, is, isNot, anyOf, noneOf, startsWith and endsWith with a Postgres regex (~*). With it the equalities use =, <> and in, as in v4, which can use the column's index.
suggest (params: { searchText: string; signal: AbortSignal }) => Promise<FilterItem[]>Suggestions while typing, for the match operator: picking one filters on its exact value (on suggestColumn), keeping the typed text filters with contains.
suggestColumn stringColumn compared with the value of a picked suggestion. Defaults to column.
blankIsEmpty booleanWith empty / notEmpty, an empty string counts as empty too. Default true.
placeholder stringPlaceholder of the input.

NumberFilterField

A number field.

interface NumberFilterField extends FieldBase

NameTypeDescription
name requiredstringIdentity of the field, stored in the conditions.
label requiredstringName shown to the user.
icon stringSVG path of an icon shown in the list, the card and the pill.
category stringGroups the fields in the list of "Add filter".
description stringSecondary text in the list of fields.
column stringColumn of the query. Defaults to name.
joins FilterJoin[]Joins added to the query when the field has a condition.
through FilterThrough | FilterThrough[]The condition is checked in a subquery on a related table (column is a column of the last hop). Several hops nest.
operators FilterOperatorSet | (string | FilterOperatorDefinition)[]Operators offered, in this order: names of the built-in ones of the type, definitions of new ones, or a whole set (basic, standard, all). Defaults to the set chosen on Filters (standard).
defaultOperator stringOperator of a new condition. Defaults to the first one.
pinned booleanAlways shown as a pill in the bar, even without a condition.
hidden booleanNever shown: its conditions (usually locked) only reach the query.
defaultValue FilterConditionValueValue of a new condition on this field (the card and the panel start with it).
isComplete (condition: FilterCondition) => booleanDecides when a condition on this field is complete (it reaches the query and gets a pill). Defaults to a check on the value for the operator.
apply (builder: FilterBuilder, condition: FilterCondition) => voidReplaces the whole query of a condition on this field.
whenAbsent (builder: FilterBuilder) => voidQuery added when the field has no condition at all (for example "hide archived" until the user asks for them).
format (condition: FilterCondition) => stringReplaces the text of the value in the pill.
negativesIncludeEmpty booleanNegative operators (isNot, notContains, ne, notIn, noneOf, notBetween) also keep the rows where the column is empty: "surname is not Rossi" shows the clients without a surname too. On by default (option of Filters / filtersToBuilder); this one wins. Needs a backend that knows null modifiers: pass false for backends E and E'.
json { column: string; key: string; cast?: 'text' | 'numeric' | 'date' | 'timestamp' | 'boolean' }The value lives in a key of a JSONB column (customFields.color): equalities use whereJsonSuperset; with cast every operator works through a parametrized whereRaw (accepted only by backends that allow raw conditions).
type required'number'
unit stringText after the value (€, kg).
scale numberMultiplies the typed value before the query (for example 1000 to type tons of a column in kilograms).
step numberstep of the input.
compareWith { column: string; label: string }[]Other columns the value can be compared with (quantity < minimum quantity): adds the column operators.

DateFilterField

A date field.

interface DateFilterField extends FieldBase

NameTypeDescription
name requiredstringIdentity of the field, stored in the conditions.
label requiredstringName shown to the user.
icon stringSVG path of an icon shown in the list, the card and the pill.
category stringGroups the fields in the list of "Add filter".
description stringSecondary text in the list of fields.
column stringColumn of the query. Defaults to name.
joins FilterJoin[]Joins added to the query when the field has a condition.
through FilterThrough | FilterThrough[]The condition is checked in a subquery on a related table (column is a column of the last hop). Several hops nest.
operators FilterOperatorSet | (string | FilterOperatorDefinition)[]Operators offered, in this order: names of the built-in ones of the type, definitions of new ones, or a whole set (basic, standard, all). Defaults to the set chosen on Filters (standard).
defaultOperator stringOperator of a new condition. Defaults to the first one.
pinned booleanAlways shown as a pill in the bar, even without a condition.
hidden booleanNever shown: its conditions (usually locked) only reach the query.
defaultValue FilterConditionValueValue of a new condition on this field (the card and the panel start with it).
isComplete (condition: FilterCondition) => booleanDecides when a condition on this field is complete (it reaches the query and gets a pill). Defaults to a check on the value for the operator.
apply (builder: FilterBuilder, condition: FilterCondition) => voidReplaces the whole query of a condition on this field.
whenAbsent (builder: FilterBuilder) => voidQuery added when the field has no condition at all (for example "hide archived" until the user asks for them).
format (condition: FilterCondition) => stringReplaces the text of the value in the pill.
negativesIncludeEmpty booleanNegative operators (isNot, notContains, ne, notIn, noneOf, notBetween) also keep the rows where the column is empty: "surname is not Rossi" shows the clients without a surname too. On by default (option of Filters / filtersToBuilder); this one wins. Needs a backend that knows null modifiers: pass false for backends E and E'.
json { column: string; key: string; cast?: 'text' | 'numeric' | 'date' | 'timestamp' | 'boolean' }The value lives in a key of a JSONB column (customFields.color): equalities use whereJsonSuperset; with cast every operator works through a parametrized whereRaw (accepted only by backends that allow raw conditions).
type required'date'
dateOnly booleanThe column is a date (no time): the query compares yyyy-MM-dd strings. Otherwise it compares timestamps from the start to the end of the local days.
periods FilterPeriod[]Periods offered by the period operator, in this order.
withTime booleanThe value has a time too: before, after, between and the relative operators compare instants (yyyy-MM-ddTHH:mm), and minutes and hours become available.
compareWith { column: string; label: string }[]Other columns the value can be compared with (deliveredAt after promisedAt): adds the column operators.

SelectFilterField

A field whose value is chosen among options.

interface SelectFilterField extends FieldBase

NameTypeDescription
name requiredstringIdentity of the field, stored in the conditions.
label requiredstringName shown to the user.
icon stringSVG path of an icon shown in the list, the card and the pill.
category stringGroups the fields in the list of "Add filter".
description stringSecondary text in the list of fields.
column stringColumn of the query. Defaults to name.
joins FilterJoin[]Joins added to the query when the field has a condition.
through FilterThrough | FilterThrough[]The condition is checked in a subquery on a related table (column is a column of the last hop). Several hops nest.
operators FilterOperatorSet | (string | FilterOperatorDefinition)[]Operators offered, in this order: names of the built-in ones of the type, definitions of new ones, or a whole set (basic, standard, all). Defaults to the set chosen on Filters (standard).
defaultOperator stringOperator of a new condition. Defaults to the first one.
pinned booleanAlways shown as a pill in the bar, even without a condition.
hidden booleanNever shown: its conditions (usually locked) only reach the query.
defaultValue FilterConditionValueValue of a new condition on this field (the card and the panel start with it).
isComplete (condition: FilterCondition) => booleanDecides when a condition on this field is complete (it reaches the query and gets a pill). Defaults to a check on the value for the operator.
apply (builder: FilterBuilder, condition: FilterCondition) => voidReplaces the whole query of a condition on this field.
whenAbsent (builder: FilterBuilder) => voidQuery added when the field has no condition at all (for example "hide archived" until the user asks for them).
format (condition: FilterCondition) => stringReplaces the text of the value in the pill.
negativesIncludeEmpty booleanNegative operators (isNot, notContains, ne, notIn, noneOf, notBetween) also keep the rows where the column is empty: "surname is not Rossi" shows the clients without a surname too. On by default (option of Filters / filtersToBuilder); this one wins. Needs a backend that knows null modifiers: pass false for backends E and E'.
json { column: string; key: string; cast?: 'text' | 'numeric' | 'date' | 'timestamp' | 'boolean' }The value lives in a key of a JSONB column (customFields.color): equalities use whereJsonSuperset; with cast every operator works through a parametrized whereRaw (accepted only by backends that allow raw conditions).
type required'select'
items FilterItem[]The options, when they are known.
searcher (params: { searchText: string; signal: AbortSignal }) => Promise<FilterItem[]>Loads the options matching the typed text (from an API), instead of items.
view 'autocomplete' | 'toggle' | 'countries'How the options are picked: an autocomplete (default), toggle buttons (few options), or countries with flags.
shortcuts FilterItem[]Options added at the top of the list, such as "Me" for the current user.
locale stringLocale of the country names with view: 'countries'.
placeholder stringPlaceholder of the input.
array booleanThe column (or the JSON key, with json) holds a list of values: in = has any of (&&), notIn = has none of, all = has all of (@>), empty = null or {}.

BoolFilterField

A yes/no field.

interface BoolFilterField extends FieldBase

NameTypeDescription
name requiredstringIdentity of the field, stored in the conditions.
label requiredstringName shown to the user.
icon stringSVG path of an icon shown in the list, the card and the pill.
category stringGroups the fields in the list of "Add filter".
description stringSecondary text in the list of fields.
column stringColumn of the query. Defaults to name.
joins FilterJoin[]Joins added to the query when the field has a condition.
through FilterThrough | FilterThrough[]The condition is checked in a subquery on a related table (column is a column of the last hop). Several hops nest.
operators FilterOperatorSet | (string | FilterOperatorDefinition)[]Operators offered, in this order: names of the built-in ones of the type, definitions of new ones, or a whole set (basic, standard, all). Defaults to the set chosen on Filters (standard).
defaultOperator stringOperator of a new condition. Defaults to the first one.
pinned booleanAlways shown as a pill in the bar, even without a condition.
hidden booleanNever shown: its conditions (usually locked) only reach the query.
defaultValue FilterConditionValueValue of a new condition on this field (the card and the panel start with it).
isComplete (condition: FilterCondition) => booleanDecides when a condition on this field is complete (it reaches the query and gets a pill). Defaults to a check on the value for the operator.
apply (builder: FilterBuilder, condition: FilterCondition) => voidReplaces the whole query of a condition on this field.
whenAbsent (builder: FilterBuilder) => voidQuery added when the field has no condition at all (for example "hide archived" until the user asks for them).
format (condition: FilterCondition) => stringReplaces the text of the value in the pill.
negativesIncludeEmpty booleanNegative operators (isNot, notContains, ne, notIn, noneOf, notBetween) also keep the rows where the column is empty: "surname is not Rossi" shows the clients without a surname too. On by default (option of Filters / filtersToBuilder); this one wins. Needs a backend that knows null modifiers: pass false for backends E and E'.
json { column: string; key: string; cast?: 'text' | 'numeric' | 'date' | 'timestamp' | 'boolean' }The value lives in a key of a JSONB column (customFields.color): equalities use whereJsonSuperset; with cast every operator works through a parametrized whereRaw (accepted only by backends that allow raw conditions).
type required'bool'
trueLabel stringText of isTrue in the pill and the card. Default Yes.
falseLabel stringText of isFalse. Default No.
whenTrue (builder: FilterBuilder) => voidQuery of isTrue, when it is not column = true (for example whereColumn('quantity', '<', 'minQuantity')).
whenFalse (builder: FilterBuilder) => voidQuery of isFalse, when it is not column = false.
nullable booleanThe column can be null: adds empty and notEmpty.

CustomFilterField

A field with an input of the app.

interface CustomFilterField extends FieldBase

NameTypeDescription
name requiredstringIdentity of the field, stored in the conditions.
label requiredstringName shown to the user.
icon stringSVG path of an icon shown in the list, the card and the pill.
category stringGroups the fields in the list of "Add filter".
description stringSecondary text in the list of fields.
column stringColumn of the query. Defaults to name.
joins FilterJoin[]Joins added to the query when the field has a condition.
through FilterThrough | FilterThrough[]The condition is checked in a subquery on a related table (column is a column of the last hop). Several hops nest.
operators FilterOperatorSet | (string | FilterOperatorDefinition)[]Operators offered, in this order: names of the built-in ones of the type, definitions of new ones, or a whole set (basic, standard, all). Defaults to the set chosen on Filters (standard).
defaultOperator stringOperator of a new condition. Defaults to the first one.
pinned booleanAlways shown as a pill in the bar, even without a condition.
hidden booleanNever shown: its conditions (usually locked) only reach the query.
defaultValue FilterConditionValueValue of a new condition on this field (the card and the panel start with it).
isComplete (condition: FilterCondition) => booleanDecides when a condition on this field is complete (it reaches the query and gets a pill). Defaults to a check on the value for the operator.
apply (builder: FilterBuilder, condition: FilterCondition) => voidReplaces the whole query of a condition on this field.
whenAbsent (builder: FilterBuilder) => voidQuery added when the field has no condition at all (for example "hide archived" until the user asks for them).
format (condition: FilterCondition) => stringReplaces the text of the value in the pill.
negativesIncludeEmpty booleanNegative operators (isNot, notContains, ne, notIn, noneOf, notBetween) also keep the rows where the column is empty: "surname is not Rossi" shows the clients without a surname too. On by default (option of Filters / filtersToBuilder); this one wins. Needs a backend that knows null modifiers: pass false for backends E and E'.
json { column: string; key: string; cast?: 'text' | 'numeric' | 'date' | 'timestamp' | 'boolean' }The value lives in a key of a JSONB column (customFields.color): equalities use whereJsonSuperset; with cast every operator works through a parametrized whereRaw (accepted only by backends that allow raw conditions).
type required'custom'

FilterLogic

How the conditions of a group are combined.

type FilterLogic = 'and' | 'or'

FilterNode

A condition or a group.

type FilterNode = FilterCondition | FilterGroup

FilterLabels

Every text of the filters, to translate them. Pass the ones to change: the others keep the English default.

interface FilterLabels

NameTypeDescription
filters requiredstring
addFilter requiredstring
addNestedFilter requiredstring
clear requiredstring
clearAll requiredstring
clearGroup requiredstring
where requiredstring
and requiredstring
or requiredstring
searchFields requiredstring
noFields requiredstring
field requiredstring
operator requiredstring
value requiredstring
apply requiredstring
cancel requiredstring
remove requiredstring
close requiredstring
showResults requiredstring
editFilter requiredstring
removeFilter requiredstring
from requiredstring
to requiredstring
days requiredstring
yes requiredstring
no requiredstring
more requiredstring
conditions requiredstring
anyOf requiredstring
allOf requiredstring
addValue requiredstring
choose requiredstring
search requiredstring
amount requiredstring
showLess requiredstring
loading requiredstringText of the list while options load.
noResults requiredstringText of the list when no option matches.
searchError requiredstringText of the list when a search fails.
typeMore requiredstringText of the list before a search starts; {count} is the number of characters.
invalidDate requiredstringError of a date field with a date that does not exist.
chooseDate requiredstringAccessible name of the calendar button of a date field.
previousMonth requiredstring
nextMonth requiredstring
previousYear requiredstring
nextYear requiredstring
dateLetters requiredstringLetters of day, month and year in the format hint of date fields: dmy shows dd/mm/yyyy, gma shows gg/mm/aaaa.
invalidDateTime requiredstringError of a date and time field with a date or a time that does not exist.
chooseDateTime requiredstringAccessible name of the calendar button of a date and time field.
hours requiredstringAccessible name of the hours column of a date and time field.
minutes requiredstringAccessible name of the minutes column of a date and time field.
amPm requiredstringAccessible name of the AM/PM column of a date and time field on a 12-hour clock.
compareWith requiredstring
savedFilters requiredstring
saveFilters requiredstring
saveAs requiredstring
save requiredstring
deleteSaved requiredstring
noSaved requiredstring
unit requiredstring
units requiredRecord<FilterTimeUnit, string>
operators requiredRecord<string, string>
periods requiredRecord<FilterPeriod, string>

FilterPeriod

A period relative to today, for the date operator period.

type FilterPeriod = 'today' | 'yesterday' | 'tomorrow' | 'thisWeek' | 'lastWeek' | 'nextWeek' | 'thisMonth' | 'lastMonth' | 'nextMonth' | 'thisQuarter' | 'lastQuarter' | 'nextQuarter' | 'thisYear' | 'lastYear' | 'nextYear' | 'monthToDate' | 'quarterToDate' | 'yearToDate'

FilterTimeUnit

Unit of a relative date (inLast, inNext, olderThan, laterThan). Minutes and hours need withTime.

type FilterTimeUnit = 'minutes' | 'hours' | 'days' | 'weeks' | 'months' | 'years'

FilterConditionValue

Value of a condition. Its shape depends on the operator (see FilterInput). Dates are yyyy-MM-dd strings, so the whole tree is plain JSON.

type FilterConditionValue = string | number | boolean | { from?: number | string; to?: number | string } | FilterItem[] | FilterPeriod | unknown

FilterJoin

A join the field needs, added once per query however many conditions use it.

interface FilterJoin

NameTypeDescription
table requiredstringTable, with an alias if needed (suppliers as primary_supplier).
on required[string, string] | [string, string, string][from, to] (equality) or [from, operator, to].
kind 'left' | 'inner'Default left, so the join itself filters nothing.

FilterThrough

A hop of a relation reached through a subquery: key IN (SELECT select FROM from WHERE ...).

interface FilterThrough

NameTypeDescription
key requiredstringColumn of the outer query compared with the subquery (users.id).
from requiredstringTable of the subquery (user_residences).
select requiredstringColumn selected by the subquery (userId).
joins FilterJoin[]Joins inside the subquery.
where (builder: FilterBuilder) => voidFixed conditions inside the subquery.

FilterOperatorDefinition

An operator defined by the app for one field.

interface FilterOperatorDefinition

NameTypeDescription
name requiredstringName stored in the conditions.
label requiredstringText between the field and the value (is, ≥, has tag).
input requiredFilterInputInput shown for the value. custom uses the field's inputSnippet.
apply (builder: FilterBuilder, condition: FilterCondition) => voidAdds the query for a condition with this operator. Without it the field's apply is used.

FilterOperatorSet

How many operators the fields offer: basic the essential ones, standard the common ones (default), all every built-in one.

type FilterOperatorSet = 'basic' | 'standard' | 'all'

FilterItem

An option of a select field: an Item, optionally standing for several values in the query.

type FilterItem<Data = unknown> = Item<Data> & { … }

NameTypeDescription
values (string | number)[]Values the option stands for in the query (for example "In progress" = four statuses). Defaults to [value].

FilterInput

Kind of value an operator asks for, which decides the input shown to the user.

type FilterInput = 'none' | 'text' | 'texts' | 'number' | 'numbers' | 'numberRange' | 'date' | 'dateRange' | 'datetime' | 'datetimeRange' | 'days' | 'relative' | 'period' | 'items' | 'column' | 'suggest' | 'custom'

Item

An option of a picker (Autocomplete, Select, ...).

type Item<Data = unknown> = { … }

NameTypeDescription
value requiredstring | numberIdentity of the option: two items are the same option when their values are equal (===).
label string | numberText shown and searched. Defaults to value.
icon stringSVG path of an icon shown before the label, for example from @mdi/js.
data DataAny extra data, available in snippets and callbacks.

CSS variables

For a single instance, pass them as style props: <Filters --filters-count-color="tomato">. The --filters-default-* defaults apply to the whole app: override them in :root or in a theme.

Per-instance variableDefault
--filters-gap
--filters-default-gap 8px
--filters-width100%
--filters-count-background
--filters-default-count-background var(--global-color-primary-soft)
--filters-count-color
--filters-default-count-color var(--global-color-primary)
--filters-field-list-width260px
--filters-field-list-max-height320px
--filters-group-padding
--filters-default-group-padding 14px
--filters-group-border-color
--filters-default-group-border-color var(--global-color-border)
--filters-group-border-radius
--filters-default-group-border-radius var(--global-radius-md)
--filters-group-background
--filters-default-group-background var(--global-color-surface-3)
--filters-group-alt-background
--filters-default-group-alt-background var(--global-color-surface-pop)
--filters-pill-height
--filters-default-pill-height 30px
--filters-pill-border-color
--filters-default-pill-border-color var(--global-color-border-strong)
--filters-pill-border-radius
--filters-default-pill-border-radius var(--global-radius-md)
--filters-pill-background
--filters-default-pill-background var(--global-color-surface-solid)
--filters-pill-box-shadow
--filters-default-pill-box-shadow var(--global-shadow-sm)
--filters-pill-font-size
--filters-default-pill-font-size 13px
--filters-pill-key-color
--filters-default-pill-key-color var(--global-color-text-3)
--filters-pill-divider-color
--filters-default-pill-divider-color var(--global-color-border)
--filters-pill-operator-color
--filters-default-pill-operator-color var(--global-color-primary)
--filters-pill-value-max-width220px
--filters-pill-value-color
--filters-default-pill-value-color var(--global-color-text)
--filters-pill-remove-hover-background
--filters-default-pill-remove-hover-background var(--global-color-error-soft)
--filters-pill-remove-hover-color
--filters-default-pill-remove-hover-color var(--global-color-error)
--filters-add-hover-color
--filters-default-add-hover-color var(--global-color-primary)
--filters-add-border-color
--filters-default-add-border-color var(--global-color-border-strong)
--filters-add-color
--filters-default-add-color var(--global-color-text-2)
--filters-connective-color
--filters-default-connective-color var(--global-color-text-3)
--filters-panel-width
--filters-default-panel-width 880px
--filters-panel-padding
--filters-default-panel-padding 16px