Component libraryRule builder
Components/Blocks

Rule builder

Pro

Define controlled IF conditions and ordered THEN actions without executing an automation.

npx shadcn@latest add @tidal-pro/rule-builder
Desktop viewport

Installation

Pro source is gated. Configure the @tidal-pro registry using the agent guide. Create an access key from your account after purchasing.

Terminal
npx shadcn@latest add @tidal-pro/rule-builder

Import components/ui/tidal.css, components/ui/rule-builder.css, components/ui/query-builder.css, then add the component inside a tidal-scope wrapper. Its scoped design tokens keep it independent of your existing CSS.

Usage

Complete example source · Dependency and asset manifest

Loading the complete example…

API & behavior

Consumer-owned conditions compose the accepted Query builder and retain its flat AND/OR field, operator, value, validation, native-handler, ref and focus contracts. Ordered actions use unique IDs plus consumer-defined text, finite-number, enum or no-value definitions. onActionsChange receives the complete proposed array, typed add/remove/move/definition/value detail and native event, so consumers may accept or decline every change. Enabled native action handlers run first and prevention stops proposals; disabled handlers do not run. Add and accepted removal recover focus only from the exact source and use visible action controls, Add or the persistent labelled actions region without scrolling unrelated ancestors. Move controls remain native buttons and keyed rows preserve their focus. The native form supports action/method and exact FormData names through namePrefix, plus cleanup-aware form/control refs, per-action native props, aggregate disabled/pending state, optional errors, summary and submit action. Invalid condition configuration, unknown or duplicate action IDs, unavailable definitions/enum values, malformed finite numbers and malformed definitions fail visibly and block native submission. Controls retain ordinary Tab order, 44px targets, 16px narrow inputs, RTL, forced colors and reduced motion. Consumers own validation, serialization, persistence and execution; the component never runs an action, request or timer-backed workflow.

Style with the --t-* CSS variables. Set data-theme="dark" on your tidal-scope wrapper for a dark surface. Motion respects the system’s reduced-motion preference.

Building with an agent?Give it the installation guide and component catalog.