# QueryField (@salmonui/query-builder)

> The QueryField interface of @salmonui/query-builder.

Canonical: https://salmonui.dev/docs/reference/query-builder/QueryField

```ts
import type { QueryField } from '@salmonui/query-builder';
```

Entry index: https://salmonui.dev/docs/reference/query-builder (Markdown with every symbol of the entry: https://salmonui.dev/docs/reference/query-builder.md).

## Reference

Kind: interface

```ts
interface QueryField {
    readonly field: string;
    readonly label?: string | undefined;
    readonly type?: QueryFieldType | undefined;
    readonly operators?: readonly string[] | undefined;
    readonly values?: readonly QueryFieldValue[] | undefined;
    readonly defaultValue?: Json | undefined;
    readonly format?: string | FormatOptions | undefined;
    readonly step?: number | undefined;
    readonly validation?: FieldValidation | undefined;
    readonly category?: string | undefined;
    readonly fields?: readonly QueryField[] | undefined;
    readonly renderValueEditor?: ((ctx: QueryValueEditorContext) => ReactNode) | undefined;
}
```

Members (12):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `field` | `readonly field: string;` |  | Field name; with `fields` it is the path segment of the children. |
| `label` | `readonly label?: string \| undefined;` | optional |  |
| `type` | `readonly type?: QueryFieldType \| undefined;` | optional | Default `'string'`. |
| `operators` | `readonly operators?: readonly string[] \| undefined;` | optional | Operators offered (Data Grid filter operator names or custom ones); default per type (`operatorsFor`). |
| `values` | `readonly values?: readonly QueryFieldValue[] \| undefined;` | optional | Fixed values: a Select (or a multiple Select for `in` / `notIn`). |
| `defaultValue` | `readonly defaultValue?: Json \| undefined;` | optional | Value of a new rule on this field. |
| `format` | `readonly format?: string \| FormatOptions \| undefined;` | optional | Display format of values (summary): a Data Grid format (`'N2'`, `'C2'`, `'yMMMd'`, `'dd/MM/yyyy'`) or format options. |
| `step` | `readonly step?: number \| undefined;` | optional | Step of the numeric editor. |
| `validation` | `readonly validation?: FieldValidation \| undefined;` | optional | Rules of the value (the Form rule vocabulary), checked by `validation` / `api.validate()`. |
| `category` | `readonly category?: string \| undefined;` | optional | Group of the field in the field list. |
| `fields` | `readonly fields?: readonly QueryField[] \| undefined;` | optional | Nested fields: paths `parent.child` with `pathSeparator`. A field with children is not selectable itself. |
| `renderValueEditor` | `readonly renderValueEditor?: ((ctx: QueryValueEditorContext) => ReactNode) \| undefined;` | optional | Custom value editor. |
