SVAR Svelte Filter - a flexible and customizable filter builder (query builder) for Svelte apps
npm install wx-svelte-filter


SVAR Svelte Filter helps you add flexible filtering features to your Svelte apps: from simple filter bars to advanced query builders. It provides an intuitive UI to create and edit filtering rules, group filters, define conditions, and choose combining logic (AND/OR).

The package includes 3 widgets:
- FilterBuilder - the main component that provides an interactive interface for building complex queries and filtering large datasets.
- FilterEditor - allows you to create a filtering rule for a single field, and can be used as a standalone component.
- FilterBar - a simplified filter bar UI with inputs and select controls. It allows building filtering rules for several fields and combining them with logical operators.
- Complex filter queries: multi-field rules, groups of filters, nested filters, AND/OR logic.
- Multiple data types: text, number, and date filtering with type-specific operators.
- Configurable layouts: vertical, horizontal, or minimal filter bar layouts.
- Localization: labels and date formats can be customized to match users' locale.
- Dynamic loading: filter options can be loaded on demand when a new filter is added.
- JSON output: the component outputs structured JSON that can be transformed into SQL or other query formats.
- Intuitive, straightforward API: easily set and retrieve values, customize filters, and track changes.
- Full TypeScript support with complete type definitions.
Check out the demos to see all SVAR Filter features in action.
You can install SVAR Svelte Filter as follows:
```
npm install @svar-ui/svelte-filter
To use SVAR Filter, simply import the package and include the component in your Svelte file:
`
`
For further instructions, see the detailed how-to-start guide.
Typically, you don't need to modify the code. However, if you wish to do so, follow these steps:
1. Run yarn to install dependencies. Note that this project is a monorepo using yarn workspaces, so npm will not workyarn start
2. Start the project in development mode with
To run the test:
1. Start the test examples with:
`sh`
yarn start:tests
`
2. In a separate console, run the end-to-end tests with:
sh``
yarn test:cypress
Join our community forum to get help or post feature requests.