WingoUI
Buttons & Actions
ButtonButton GroupCopy ButtonDelete ButtonTheme ToggleToggleToggle Group
Inputs
Avatar UploadCalendarCheckboxColor PickerComboboxCron PickerCurrency InputDate PickerDate Range PickerDate Time PickerDuration PickerFile UploadFilter BuilderInputInput GroupListboxMasked InputMention InputMonth PickerMulti SelectNumber InputOTP InputPassword InputPhone InputRadio GroupRatingSearch InputSegmented ControlSelectSignature PadSliderSwitchTag InputTextareaTime Picker
Forms
Address InputCSV ImportFieldForm WizardInline EditInvoice line itemsRich Text Editor
Navigation
Back To TopBounce SidebarBreadcrumbCommand MenuGlobal SearchGooey NavHook SidebarNav MenuNav TabsPaginationProximity SidebarScroll ProgressSidebarStepsTable Of ContentsTabsTopbarUser MenuWorkspace Switcher
Overlays
Alert DialogContext MenuDialogDrawerDropdown MenuFamily DrawerHover CardPopoverSheetShortcuts DialogTooltipTour
Feedback
AlertBannerCookie ConsentEmoji ReactionEmpty StateNotification BellNotification CenterProgressRoute ProgressSkeletonSpinnerToast
Data Display
Approval FlowAvatarBadgeCalendar ViewCode BlockComment ThreadContact cardCountdownDescription ListDiff ViewerFile ListFile managerFolderGanttJSON ViewerKbdLog ViewerMarkdownPresenceSchedulerTagTimelineTree View
Tables & Lists
Audit LogData TableDeal PipelineEditable GridKanbanListMembers tablePermissions MatrixTableTask ListVirtual List
Charts & Stats
Animated CounterArea chartBar chartDonut chartFunnel chartGaugeGitHub ActivityHeatmap calendarLeaderboardLine chartRadial barSparklineStat CardTrackerTrend badge
Layout
AccordionApp ShellCardCollapsibleDetail LayoutEntity HeaderPage HeaderScroll AreaSeparatorSettings LayoutSplit ViewToolbar
Media
Audio PlayerCarouselImage CropperImage LightboxLocation MapQR CodeStep PlayerVideo Player
AI Kit
Agent Status CardChat MessageChat ThreadConversation ListFluid OrbGrid RevealMatrix OrbModel PickerPrompt InputReasoning IndicatorRule BuilderSuggestion ChipsTool Call TimelineUsage MeterVoice InputWorkflow Canvas
Text & Effects
Gravity Letters
Mobile
Action SheetBottom Tab BarFABHaptic ButtonHero HeaderInstall PromptLarge Title HeaderNotification BannerOnboarding CarouselPicker WheelPull To RefreshSlide To ConfirmSticky CTA BarSwipe DeckSwipeable Tabs
Commerce
Cart drawerCategory pickerCheckout stepsCoupon inputFavorite buttonFilter panelListing cardListing gridOrder trackerPricePrice rangePricing tableProduct galleryQuantity stepperReviewsSeller card
Blocks
Admin Dashboard PageAdmin ShellAI Chat PageAutomation Builder PageCheckout PageCRM Contact PageCRM Pipeline PageError PagesInbox PageInvoice PageKPI DashboardListing Detail PageLogin PageMarketplace Home PageMarketplace Search PageMarketplace ShellMobile App HomeOnboarding FlowPost Listing WizardPricing PageRegister PageSettings PageUsers Admin Page
Hooks & Utilities
AI ChatChart kitCommerceDate utilsFile exportFile typesFiltersForm validationHapticsInvoicingMotion presetsNavigationNumber formatRelative timeRomanian locationsSpreadsheetText matchTonesUIProvideruseClipboarduseConsentuseControllableStateuseCooldownuseDebounceuseKeyboardInsetuseLocaleuseLongPressuseMediaControlsuseMediaQueryuseOverflowItemsusePersistedStateuseScrollEdgesuseScrollStateuseSelectionuseShortcutuseStickToBottom
GalleryThemeCredits

AI Kit

Rule Builder

AI KitRule Builder
Reasoning IndicatorSuggestion Chips
Live props
Content
title
currency
locale
State
defaultEnabled
readOnly
disabled
Behavior
allowOr
maxActionsNo limit
validate
responsive
Layout
showSummary
summaryPosition
Appearance
size
tone
color
Code
import { RuleBuilder } from "@/components/ui/rule-builder"

<RuleBuilder />
Pro

v1.0.0·Added in 1.0.0

An if-this-then-that editor for automations: a trigger, conditions and ordered actions as sentence cards, read back as one sentence.

Pick a trigger from the dashed card, then press any step card to edit it: on a desktop the editor opens under the card, on a phone it rises as a bottom sheet. Edits are drafts: Apply, or Enter in a one-line field, saves them; Cancel, Escape or closing the sheet throws them away, and Apply stays dimmed until the required fields are filled (pressing it anyway points at them). Add conditions from the trigger's fields and choose whether all or any must match; add actions from the catalog and reorder them by dragging the grip (on a phone only the grip drags, the rest of the card scrolls the page), with Alt+Up or Alt+Down on a card, or with Space, the arrows and Space again on the grip. Each card's more button offers Edit, Duplicate, Move up, Move down and Remove (the trigger's offers Change trigger). Up, Down, Home and End move between the cards, Tab reaches a card's grip and more button. The header switch turns the rule on or off, and a stopped rule's cards dim; Test runs onTest and shows each action's outcome under the summary, which reads the whole rule as one sentence.

Add to a project

npx wingo-ui@latest add rule-builder

Pro item: the CLI needs a Pro account. See plans

Dependencies

@dnd-kit/core@dnd-kit/sortable@dnd-kit/utilitiesmotionlucide-reactbuttoncurrency-inputdrawerdropdown-menufieldinputmulti-selectnumber-inputsegmented-controlselectswitchtextareause-controllable-stateuse-localeuse-media-queryai-chatcommercefiltersmotionnumber-formattonesui-config

Files

  • components/ui/rule-builder.tsx

See also

FilterslibFilter BuilderSelectSwitch
PreviousReasoning IndicatorNext Suggestion Chips
Final notice after 30 days
When
If
and
Then
1
2
3

In short

When an invoice is 30 days overdue, if Amount ≥ $5,000 and City is any of Austin or Portland, then send the “Final notice” email to the client, personalized with AI, create a task for Julia Davis due in 2 days and add the Overdue tag.

Test record

Invoice #2026-0371

Wellness Pharmacy, Portland

$7,315.20 · 53 days overdue

Owner: Julia Davis

Test rule runs the rule on this record, with the current conditions.

Ready to save
validateRule
0 issues
validate=touchedresponsive=truemaxActions=0locale="" → en-UScurrency=USDenabled=true
JSON.stringify(value)
{
  "trigger": {
    "type": "invoice-overdue",
    "params": {
      "days": 30
    }
  },
  "conditions": {
    "id": "cond-root",
    "combinator": "and",
    "conditions": [
      {
        "id": "cond-amount",
        "field": "amount",
        "operator": "gte",
        "value": 5000
      },
      {
        "id": "cond-city",
        "field": "city",
        "operator": "any-of",
        "value": [
          "Austin",
          "Portland"
        ]
      }
    ]
  },
  "actions": [
    {
      "id": "act-email",
      "type": "send-email",
      "params": {
        "to": "client",
        "template": "somatie",
        "personalize": true
      }
    },
    {
      "id": "act-task",
      "type": "create-task",
      "params": {
        "assignee": "ioana",
        "due": 2,
        "title": "Call the client about the overdue invoice"
      }
    },
    {
      "id": "act-tag",
      "type": "add-tag",
      "params": {
        "tag": "restant"
      }
    }
  ]
}

Click a card to edit it in place. Drag the grip, or press Alt+Up / Alt+Down, to reorder actions.Tap a card: its editor opens as a sheet. Drag a grip to reorder.