DocsThe builder

Interactions

Make elements respond to clicks, scrolling, forms and more without code: a trigger, optional conditions, and a sequence of actions on the elements you choose.

An interaction says: when something happens (the trigger), if these conditions are true, do these actions, on these elements. Open Advanced → Interactions on the element that starts it. An element can have up to ten.

An interaction on the cookie notice’s Accept button: on click, remember the choice and close the popup
An interaction on a cookie notice’s Accept button: on click, remember the choice and close the popup.

Triggers#

30 triggers:

TriggerGroupWhen it runs
ClickMouseThe element is clicked (or activated with Enter or Space).
Double clickMouseThe element is double-clicked.
Hover (in and out)MouseThe pointer enters the element; leaving undoes the actions. Keyboard focus counts too.
Mouse enterMouseThe pointer enters the element.
Mouse leaveMouseThe pointer leaves the element.
Click outsideMouseA click anywhere outside the element (closing menus and panels).
FocusKeyboardThe element, or something in it, receives focus.
BlurKeyboardFocus leaves the element.
Key pressKeyboardA key is pressed anywhere on the page (Escape, mod+k…).
ChangeFormsA field's value is changed.
InputFormsSomeone types in a field.
Form submitFormsA form is submitted (before it's sent).
Form sent successfullyFormsA Native AI form was submitted and accepted.
Page loadPageThe page and its images have loaded.
Page readyPageThe page's content is ready (before images finish loading).
Window resizePageThe browser window changes size.
Scroll pastScrollingThe page scrolls past a distance (or an element with a target); with toggle, scrolling back undoes the actions.
Scroll into viewScrollingThe element scrolls into view.
Scroll out of viewScrollingThe element scrolls out of view.
Scroll progressScrollingWhile the element crosses the screen, its targets get --nai-progress from 0 to 1 (use it in styles).
Popup openedBuilder elementsA popup, modal or off-canvas panel opens (a target: that one only).
Popup closedBuilder elementsA popup, modal or off-canvas panel closes.
Tab changedBuilder elementsA Tabs element shows another tab.
Accordion opened or closedBuilder elementsAn accordion item opens or closes.
Slider changedBuilder elementsA slider or carousel moves to another slide.
Query Loop updatedBuilder elementsA Query Loop loaded more records (Load more, infinite scroll).
Custom eventCustomAn event with this name (from another interaction's Emit, or a script).
Exit intentPageThe visitor seems about to leave: the pointer heads for the tabs or the back button (on phones, a quick scroll back up). Once per page.
InactivityPageNo mouse, touch, keyboard or scroll activity for a while.
Time on the sitePageThe visitor has spent this long on the site in this visit (across pages).

Actions#

27 actions. Each can start after a delay, so several actions form a timeline:

ActionGroupWhat it does
ShowShow and hideShow the element (starts hidden with “Start hidden”, or was hidden).
HideShow and hideHide the element.
Show / hideShow and hideShow it if hidden, hide it if shown.
Add classClassesAdd a class.
Remove classClassesRemove a class.
Toggle classClassesAdd the class if missing, remove it if present.
Set stateStateTurn a state (open, active, scrolled…) on, off or over. Style it with the state in the Design tab.
Change styleStyleSet CSS properties on the element.
AnimateMotionPlay a motion preset or a custom animation.
Scroll toNavigationScroll the page to the element.
Open popupPopupsOpen a Popup, Modal or Off-canvas panel, or a Menu's mobile menu.
Close popupPopupsClose it.
Toggle popupPopupsOpen it if closed, close it if open.
Set attributeContentSet an HTML attribute (aria-*, data-*, disabled…).
Remove attributeContentRemove an HTML attribute.
Change textContentReplace the element's text.
Change imageMediaShow another image.
Play videoMediaPlay a video or audio element (or a YouTube or Vimeo embed).
Pause videoMediaPause it.
Go to URLNavigationOpen a URL (tokens allowed).
Copy to clipboardContentCopy text (or the target's text); the element gets the “copied” state for two seconds.
FocusFormsMove keyboard focus to the element.
Remember a valueStateRemember a value in the visitor’s browser, for this visit or longer, for “Remembered value” conditions (a dismissed banner, a chosen option).
Submit formFormsSubmit the form the target is (or contains).
Trigger custom eventEventsSend an event other interactions (or scripts) listen for.
Track analytics eventEventsCount an event in Native AI Analytics (when the Analytics feature is on): a name like pricing_cta_clicked, an optional category and label. Make it a conversion under Analytics → Conversions.
Run JavaScriptAdvancedAdvanced: run your own code with el, target, event and data. Needs the custom code permission.

The Animate action plays any of these animations, or a custom one with your own frames, duration, easing, repeats and stagger:

  • Fade in
  • Fade out
  • Fade up
  • Fade down
  • Fade from right
  • Fade from left
  • Slide up
  • Slide down
  • Zoom in
  • Zoom out
  • Scale in
  • Scale out
  • Blur in
  • Flip up
  • Reveal (wipe up)
  • Lift
  • Pulse
  • Shake
  • Bounce
  • Wiggle
  • Spin
  • Custom

Targets#

Each action works on a target:

  • This element
  • What was clicked (the event target)
  • Parent
  • Children
  • First child
  • Siblings
  • Next sibling
  • Previous sibling
  • An element (pick it)
  • Element with HTML id
  • Elements with class
  • CSS selector
  • The page
  • A popup (site popups)

Pick an element straight on the canvas or from a list. When you duplicate or copy elements, their interactions keep pointing inside the copy.

Conditions#

Conditions narrow when an interaction runs. WordPress checks what it can before the page is sent (logged-in visitors, roles, dates, data values). The browser checks the rest each time: screen width, whether an element has a class, or is in a state. See Display conditions.

States#

The Set state action puts an element in a state — open, active, scrolled, hover, copied, expanded, or a name of your own. Style that state in the Design tab, and the canvas previews it while you edit. aria-expanded stays in step for accessibility. Elements can also Start hidden until an interaction shows them.

Presets#

10 ready-made interactions:

PresetWhat it does
Fade up into viewFades and rises in the first time it scrolls into view.
Stagger children into viewIts children fade up one after another when it scrolls into view.
Header state after scrollingAdds the “scrolled” state after 80px of scrolling and removes it at the top. Style Scrolled in the Design tab (a solid background, a smaller logo…).
Click to reveal the next elementShows or hides the element after it, and marks this one open (for an arrow that turns).
Lift on hoverRises slightly while hovered.
Hover state (for its parts)Adds the “hover” state while hovered or focused, so parts inside can change (reveal an arrow, tint an image).
Back to topScrolls to the top of the page.
Copy on clickCopies its text (or the text you enter) and shows the “copied” state for two seconds.
Pulse when seenA gentle pulse the first time it scrolls into view (calls to action).
Reading progressSets --nai-progress from 0 to 1 as the page scrolls; use it as a width or scale in styles.

Your own presets live in the design system (Design system → Interactions). Elements that use a preset follow it when it changes; unlink one to edit a copy.

Custom JavaScript#

The Run JavaScript action runs your own code with el, target, event and data. Adding or changing it needs the Add custom code permission, and the AI never writes it.