type
Description
Optional. Defines the type of filterThe filter type is required when the fields property is not defined. If not provided, the type is set to "text".
Usage
type?: "number" | "text" | "date" | "tuple";
Parameters
The type of filter can be one of the following:
- "text" - (default) for string values
- "number" - for numeric values
- "date" - for Date objects
- "tuple" - for numeric values supplied with human-readable formatted labels
Example
<script>
import { getData } from "./common/data";
import { FilterEditor } from "@svar-ui/svelte-filter";
const { options } = getData();
</script>
<FilterEditor {options} type="number" />
Related articles: FilterEditor Guide