# createFilter API

> Auto-generated API reference for `createFilter` from @vuetify/v0 (Vuetify0).
> Source of truth: https://0.vuetifyjs.com/api/create-filter

## Related

- https://0.vuetifyjs.com/composables/data/create-filter
- https://0.vuetifyjs.com/composables/data/create-data-table
- https://0.vuetifyjs.com/composables/data/create-pagination
- https://0.vuetifyjs.com/composables/data/create-virtual

## Functions

### createFilter

Creates a filter context with pre-configured options.

```ts
(options?: FilterOptions) => E
```

### createFilterContext

Creates a filter context with dependency injection support.

```ts
(_options?: FilterContextOptions) => ContextTrinity<E>
```

### useFilter

Returns the current filter context from dependency injection.

```ts
(namespace?: string) => E
```

## Options

| Name | Type | Default | Required | Description |
|---|---|---|---|---|
| `customFilter` | `FilterFunction \| undefined` | — | no | — |
| `keys` | `string[] \| undefined` | — | no | — |
| `mode` | `FilterMode \| undefined` | — | no | — |

## Methods

| Name | Type | Description |
|---|---|---|
| `apply` | `<T extends Z>(query: FilterQuery, items: MaybeRefOrGetter<T[]>) => FilterResult<T>` | Apply filter to an array of items |

## Properties

| Name | Type | Description |
|---|---|---|
| `mode` | `FilterMode` | The filter mode |
| `keys` | `string[] \| undefined` | Keys to filter on for object items |
| `customFilter` | `FilterFunction \| undefined` | Custom filter function |
| `query` | `ShallowRef<Primitive \| Primitive[]>` | Current query ref |
