Logo
Neura UI
Loading…
 Logo

Rule Builder

Nested WHEN / THEN rules with AND/OR groups, locked conditions, numeric & date comparisons (greater than / less than), multi-select chips, and If true / If false actions.

Basic Usage

Pass fields (same schema as Filters) and optional actions . The value is a tree under when plus then.ifTrue / then.ifFalse :
blade

<neura::rule-builder
    :fields="$fields"
    :actions="$actions"
    :value="$value"
    wire:model.live="rule"
/>

Empty builder

Start from an empty WHEN group and grow rules / groups from the toolbar:
blade

<neura::rule-builder
    :fields="$fields"
    :actions="$actions"
/>

Numeric & date comparisons

Fields typed number or date expose the greater_than and less_than operators in addition to is / is_not . Numbers render a numeric input, dates render a date picker:
blade

<neura::rule-builder
    :fields="$fields" 
/>

Props

Property Type Default Description
fields array [] Field configs (key, label, type, options, operators) — same as Filters.
actions array [] Action defs for THEN branches (key, label, params[]).
value array|null null { when: Group, then: { ifTrue, ifFalse } }
maxDepth int 3 Max nesting depth for groups (root counts as 0).
disabled bool false Disable editing.
size string sm Density: xs, sm, md, lg, xl.
wire:model / x-model binding Two-way bind the value tree; also dispatches rule-builder-changed .