# QueryBuilderProps (@salmonui/query-builder)

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

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

```ts
import type { QueryBuilderProps } 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 QueryBuilderProps {
    readonly fields: readonly QueryField[];
    readonly value?: QueryGroup | undefined;
    readonly defaultValue?: QueryGroup | undefined;
    readonly onValueChange?: ((value: QueryGroup, details: QueryBuilderChangeDetails) => void) | undefined;
    readonly onBeforeChange?: ((event: QueryBuilderBeforeChangeEvent) => void) | undefined;
    readonly operators?: readonly QueryOperator[] | undefined;
    readonly notCondition?: boolean | undefined;
    readonly buttons?: QueryBuilderButtons | undefined;
    readonly maxGroups?: number | undefined;
    readonly addRuleToNewGroups?: boolean | undefined;
    readonly autoSelectField?: boolean | undefined;
    readonly autoSelectOperator?: boolean | undefined;
    readonly fieldSort?: 'asc' | 'desc' | null | undefined;
    readonly matchCase?: boolean | undefined;
    readonly summary?: boolean | undefined;
    readonly fieldPicker?: 'list' | 'tree' | undefined;
    readonly pathSeparator?: string | undefined;
    readonly validation?: boolean | undefined;
    readonly readOnly?: boolean | undefined;
    readonly disabled?: boolean | undefined;
    readonly reorderable?: boolean | undefined;
    readonly onDragStart?: ((event: QueryBuilderDragEvent) => void) | undefined;
    readonly onDrag?: ((event: QueryBuilderDragEvent) => void) | undefined;
    readonly onDrop?: ((event: QueryBuilderDropEvent) => void) | undefined;
    readonly renderRule?: ((ctx: QueryRuleRenderContext) => ReactNode) | undefined;
    readonly renderGroupHeader?: ((ctx: QueryGroupHeaderContext) => ReactNode) | undefined;
    readonly editorProps?: QueryBuilderEditorProps | undefined;
    readonly localeText?: Partial<QueryBuilderLocaleText> | undefined;
    readonly locale?: string | undefined;
    readonly name?: string | undefined;
    readonly form?: string | undefined;
    readonly id?: string | undefined;
    readonly className?: string | undefined;
    readonly style?: CSSProperties | undefined;
    readonly 'aria-label'?: string | undefined;
    readonly 'aria-labelledby'?: string | undefined;
    readonly dir?: 'ltr' | 'rtl' | undefined;
    readonly ref?: Ref<QueryBuilderApi> | undefined;
}
```

Members (38):

| Name | Signature | Flags | Description |
| --- | --- | --- | --- |
| `fields` | `readonly fields: readonly QueryField[];` |  |  |
| `value` | `readonly value?: QueryGroup \| undefined;` | optional |  |
| `defaultValue` | `readonly defaultValue?: QueryGroup \| undefined;` | optional |  |
| `onValueChange` | `readonly onValueChange?: ((value: QueryGroup, details: QueryBuilderChangeDetails) => void) \| undefined;` | optional |  |
| `onBeforeChange` | `readonly onBeforeChange?: ((event: QueryBuilderBeforeChangeEvent) => void) \| undefined;` | optional |  |
| `operators` | `readonly operators?: readonly QueryOperator[] \| undefined;` | optional | Custom operators. |
| `notCondition` | `readonly notCondition?: boolean \| undefined;` | optional | NOT toggles on groups. Default false. |
| `buttons` | `readonly buttons?: QueryBuilderButtons \| undefined;` | optional |  |
| `maxGroups` | `readonly maxGroups?: number \| undefined;` | optional | Maximum group nesting levels, the root included. Default 5. |
| `addRuleToNewGroups` | `readonly addRuleToNewGroups?: boolean \| undefined;` | optional | A new group starts with one rule. Default true. |
| `autoSelectField` | `readonly autoSelectField?: boolean \| undefined;` | optional | A new rule starts with the first field. Default false. |
| `autoSelectOperator` | `readonly autoSelectOperator?: boolean \| undefined;` | optional | A rule gets its field's first operator when the field is picked. Default true. |
| `fieldSort` | `readonly fieldSort?: 'asc' \| 'desc' \| null \| undefined;` | optional | Field list order. Default `null` (as given). |
| `matchCase` | `readonly matchCase?: boolean \| undefined;` | optional | Written to every condition (`matchCase`). |
| `summary` | `readonly summary?: boolean \| undefined;` | optional | Read-only sentence view with an Edit button. |
| `fieldPicker` | `readonly fieldPicker?: 'list' \| 'tree' \| undefined;` | optional | Field picker: `'list'` (default) is a `Select` grouped by `field.category`; `'tree'` is a `TreeSelect` with categories and nested `field.fields` as parents (a lazy chunk). |
| `pathSeparator` | `readonly pathSeparator?: string \| undefined;` | optional | Separator of nested field paths. Default `'.'`. |
| `validation` | `readonly validation?: boolean \| undefined;` | optional | Show errors of incomplete rules and field rules. |
| `readOnly` | `readonly readOnly?: boolean \| undefined;` | optional |  |
| `disabled` | `readonly disabled?: boolean \| undefined;` | optional |  |
| `reorderable` | `readonly reorderable?: boolean \| undefined;` | optional | Drag reorder with handles and keyboard move commands (Alt+ArrowUp / Alt+ArrowDown on a handle). |
| `onDragStart` | `readonly onDragStart?: ((event: QueryBuilderDragEvent) => void) \| undefined;` | optional |  |
| `onDrag` | `readonly onDrag?: ((event: QueryBuilderDragEvent) => void) \| undefined;` | optional | Once per frame while dragging. |
| `onDrop` | `readonly onDrop?: ((event: QueryBuilderDropEvent) => void) \| undefined;` | optional |  |
| `renderRule` | `readonly renderRule?: ((ctx: QueryRuleRenderContext) => ReactNode) \| undefined;` | optional |  |
| `renderGroupHeader` | `readonly renderGroupHeader?: ((ctx: QueryGroupHeaderContext) => ReactNode) \| undefined;` | optional |  |
| `editorProps` | `readonly editorProps?: QueryBuilderEditorProps \| undefined;` | optional |  |
| `localeText` | `readonly localeText?: Partial<QueryBuilderLocaleText> \| undefined;` | optional |  |
| `locale` | `readonly locale?: string \| undefined;` | optional | Locale of value formatting (summary) and the editors. Default `'en-US'`. |
| `name` | `readonly name?: string \| undefined;` | optional | Form field name: a hidden input posts the value as JSON. |
| `form` | `readonly form?: string \| undefined;` | optional |  |
| `id` | `readonly id?: string \| undefined;` | optional |  |
| `className` | `readonly className?: string \| undefined;` | optional |  |
| `style` | `readonly style?: CSSProperties \| undefined;` | optional |  |
| `aria-label` | `readonly 'aria-label'?: string \| undefined;` | optional |  |
| `aria-labelledby` | `readonly 'aria-labelledby'?: string \| undefined;` | optional |  |
| `dir` | `readonly dir?: 'ltr' \| 'rtl' \| undefined;` | optional |  |
| `ref` | `readonly ref?: Ref<QueryBuilderApi> \| undefined;` | optional |  |
