Skip to main content

ActionProps

Defined in: packages/react-querybuilder/src/types/props.ts:259

Props passed to every action component (rendered as <button> by default).

Extends​

Extended by​

Methods​

handleOnClick()​

handleOnClick(e?: MouseEvent<Element, MouseEvent>, context?: any): void

Defined in: packages/react-querybuilder/src/types/props.ts:267

Triggers the action, e.g. the addition of a new rule or group. The second parameter will be forwarded to the onAddRule or onAddGroup callback if appropriate.

Parameters​

ParameterType
e?MouseEvent<Element, MouseEvent>
context?any

Returns​

void

Properties​

className?​

optional className?: string

Defined in: packages/react-querybuilder/src/types/props.ts:76

CSS classNames to be applied.

This is string and not Classname because the Rule and RuleGroup components run clsx() to produce the className that gets passed to each subcomponent.

Inherited from​

CommonSubComponentProps.className


context?​

optional context?: any

Defined in: packages/react-querybuilder/src/types/props.ts:97

Container for custom props that are passed to all components.

Inherited from​

CommonSubComponentProps.context


disabled?​

optional disabled?: boolean

Defined in: packages/react-querybuilder/src/types/props.ts:92

Disables the control.

Inherited from​

CommonSubComponentProps.disabled


disabledTranslation?​

optional disabledTranslation?: TranslationWithLabel

Defined in: packages/react-querybuilder/src/types/props.ts:272

Translation which overrides the regular label/title props when the element is disabled.


label?​

optional label?: ReactNode

Defined in: packages/react-querybuilder/src/types/props.ts:261

Visible text.


level​

level: number

Defined in: packages/react-querybuilder/src/types/props.ts:84

The level of the current group. Always equal to path.length.

Inherited from​

CommonSubComponentProps.level


path​

path: Path

Defined in: packages/react-querybuilder/src/types/props.ts:80

Path to this subcomponent's rule/group within the query.

Inherited from​

CommonSubComponentProps.path


ruleOrGroup​

ruleOrGroup: RuleType<string, string, any, string, Record<string, any>> | RuleGroupTypeAny

Defined in: packages/react-querybuilder/src/types/props.ts:277

The RuleType or RuleGroupType/RuleGroupTypeIC associated with this element.


rules?​

optional rules?: RuleOrGroupArray

Defined in: packages/react-querybuilder/src/types/props.ts:281

Rules in this group (if the action element is for a group).


schema​

schema: Schema<{[key: string]: unknown; className?: Classname; comparator?: string | ((f: { [x: string]: unknown; label: string; disabled?: boolean | undefined; name: string; value: string; id?: string | undefined; operators?: string[] | FlexibleOptionList<{ [x: string]: unknown; label: string; disabled?: boolean | undefined; name: string; value: string; }> | FlexibleOption<...>[] | (string | FlexibleOpt..., operator: string) => boolean); defaultOperator?: string; defaultValue?: any; disabled?: boolean; id?: string; inputType?: InputType | null; label: string; matchModes?: boolean | MatchMode[] | FlexibleOption<MatchMode>[]; name: string; operators?: string[] | FlexibleOptionList<{[key: string]: unknown; disabled?: boolean; label: string; name: string; value: string; }> | FlexibleOption<string>[] | string | FlexibleOption<string>[]; placeholder?: string; subproperties?: FlexibleOptionList<{ [x: string]: unknown; label: string; disabled?: boolean | undefined; name: string; value: string; id?: string | undefined; operators?: string[] | FlexibleOptionList<{ [x: string]: unknown; label: string; disabled?: boolean | undefined; name: string; value: string; }> | FlexibleOption<...>[] | (string | FlexibleOpt...>; validator?: RuleValidator; value: string; valueEditorType?: ValueEditorType | ((operator: string) => ValueEditorType); values?: FlexibleOptionList<{[key: string]: unknown; disabled?: boolean; label: string; name: string; value: string; }>; valueSources?: ValueSources | [FlexibleOption, ...FlexibleOption[]] | ((operator: string) => ValueSources | [FlexibleOption, ...FlexibleOption[]]); }, string>

Defined in: packages/react-querybuilder/src/types/props.ts:109

All subcomponents receive the configuration schema as a prop.

Inherited from​

CommonSubComponentProps.schema


testID?​

optional testID?: string

Defined in: packages/react-querybuilder/src/types/props.ts:105

Test ID for this component.

Inherited from​

CommonSubComponentProps.testID


title?​

optional title?: string

Defined in: packages/react-querybuilder/src/types/props.ts:88

The title/tooltip for this control.

Inherited from​

CommonSubComponentProps.title


validation?​

optional validation?: boolean | ValidationResult

Defined in: packages/react-querybuilder/src/types/props.ts:101

Validation result of the parent rule/group.

Inherited from​

CommonSubComponentProps.validation


caution

API documentation is generated from the latest commit on the main branch. It may be somewhat inconsistent with official releases of React Query Builder.