Chained property access using possessive dot notation (HyperFixi extension)
on click set my.parentElement.style.display to "none"
26 translations
Loading...
Character Counterbothforms
Show character count as user types
on input set #count.innerText to my value.length
26 translations
Loading...
Clear Inputbothforms
Clear the previous input field
on click set previous <input/>.value to ""
26 translations
Loading...
Click Elsewherebothevents
Handle clicks outside element
on click from elsewhere remove .open from me
26 translations
Loading...
Close Dropdown On Outside Clickbothui-components
Close dropdown when clicking outside
on click from elsewhere remove .open from .dropdown-menu
26 translations
Loading...
Close Modal Buttonbothui-components
Close modal from button inside
on click hide closest .modal remove .modal-open from body
26 translations
Loading...
Close Modal On Backdrop Clickbothui-components
Close modal by clicking outside
on click if target matches .modal-backdrop hide .modal-backdrop end
26 translations
Loading...
Close Modal On Escapebothui-components
Close modal when pressing Escape key
on keydown[key=="Escape"] from window hide .modal remove .modal-open from body
26 translations
Loading...
Closest Ancestorbothnavigation
Toggle class on closest matching ancestor
on click toggle .expanded on closest .card
26 translations
Loading...
Computed Valuebothdata
Calculate and display computed value
on input from .quantity set #total.innerText to (the value of #price as Number) * (my value as Number)
26 translations
Loading...
Copy To Clipboardbothclipboard
Copy text to clipboard with feedback
on click call navigator.clipboard.writeText(#code.innerText) put "Copied!" into me wait 2s put "Copy" into me
26 translations
Loading...
Decrement Counterbothcounters
Decrement a numeric counter element
on click decrement #counter
26 translations
Loading...
Default Valuebothdata
Set default value if not present
on load default my @data-count to "0"
26 translations
Loading...
Disable Form On Submitbothforms
Disable submit button while processing
on submit add @disabled to <button/> in me put "Submitting..." into <button/> in me
26 translations
Loading...
Document Readybothwindow-events
Initialize app when element loads
on load call initializeApp()
26 translations
Loading...
Draggable Behaviorbothbehavior
Makes element draggable with pointer events. Use: install Draggable(dragHandle: ".titlebar")
behavior Draggable(dragHandle)
init
if no dragHandle set dragHandle to me
end
on pointerdown(clientX, clientY) from dragHandle
halt the event
trigger draggable:start
measure x
set startX to it
measure y
set startY to it
set xoff to clientX - startX
set yoff to clientY - startY
repeat until event pointerup from document
wait for pointermove(clientX, clientY) or
pointerup(clientX, clientY) from document
add { left: ${clientX - xoff}px; top: ${clientY - yoff}px; }
trigger draggable:move
end
trigger draggable:end
end
end
Dropdown Togglebothui-components
Toggle dropdown menu visibility
on click toggle .open on next .dropdown-menu halt
26 translations
Loading...
Event Debouncebothevents
Debounce input for search
on input debounced at 300ms fetch /api/search?q=${my value} as json then put it into #results
26 translations
Loading...
Event Oncebothevents
Handle event only once
on click once add .initialized to me call setup()
26 translations
Loading...
Event Throttlebothevents
Throttle scroll handler
on scroll throttled at 100ms call updateScrollPosition()
26 translations
Loading...
Exclusive Accordionbothui-components
Accordion where only one panel is open
on click remove .open from .accordion-item add .open to closest .accordion-item
26 translations
Loading...
Fade Out And Removebothanimation
Fade element out then remove from DOM
on click transition opacity to 0 over 300ms then remove me
26 translations
Loading...
Fetch Databothasync
Fetch data from an API and display it
on click fetch /api/data then put it into #result
26 translations
Loading...
Fetch JSONbothasync
Fetch JSON data and use a property
on click fetch /api/user as json then set #name.innerText to it.name
26 translations
Loading...
Fetch With Error Handlingbothasync
Handle API errors by checking response body
on click fetch /api/data as json then if it.error put it.error into #error else put it.data into #result end
26 translations
Loading...
Fetch With Loading Statebothasync
Show loading indicator during fetch
on click add .loading to me fetch /api/data then remove .loading from me put it into #result
26 translations
Loading...
Fetch With Methodbothasync
Submit form data via POST
on submit fetch /api/form with method:"POST" body:form
26 translations
Loading...
First In Collectionbothnavigation
Focus first input in parent form
on click focus first <input/> in closest <form/>
26 translations
Loading...
Focus Elementbothfocus
Focus an input element
on click focus #input
26 translations
Loading...
Focus Trapbothaccessibility
Trap focus within modal
on keydown[key=="Tab"] from .modal if target matches last <button/> in .modal focus first <button/> in .modal halt end
26 translations
Loading...
Get Attribute (Possessive Dot)lokascripthyperfixi-extensions
Call getAttribute using possessive dot notation (HyperFixi extension)
on click put my.getAttribute("data-id") into #output
26 translations
Loading...
Get Input Value (Possessive Dot)lokascripthyperfixi-extensions
Mirror input value using possessive dot notation (HyperFixi extension)
on input put my.value into #preview
26 translations
Loading...
Get Valuebothdata
Get a value and use it
on click get #input.value then log it
26 translations
Loading...
Go Backbothnavigation
Navigate back in history
on click go back
26 translations
Loading...
Go To URLbothnavigation
Navigate to a URL
on click go to url "/page"
26 translations
Loading...
Halt Eventbothcontrol-flow
Stop event propagation
on click halt the event then toggle .active
26 translations
Loading...
Hide Elementbothvisibility
Hide an element
on click hide #modal
26 translations
Loading...
Hide With Transitionbothvisibility
Hide element with opacity transition
on click hide me with *opacity
26 translations
Loading...
If Conditionbothcontrol-flow
Conditional execution based on state
on click if I match .active then remove .active else add .active end
26 translations
Loading...
If Element Existsbothcontrol-flow
Check if element exists before action
on click if #modal exists show #modal else make a <div#modal/> put it into body end
26 translations
Loading...
If Matches Selectorbothcontrol-flow
Check if element matches selector
on click if I match .disabled halt else toggle .active end
26 translations
Loading...
If Value Emptybothcontrol-flow
Validate empty input
on blur if my value is empty add .error to me put "Required" into next .error-message end
26 translations
Loading...
Increment By Amountbothcounters
Increment counter by specific amount
on click increment #score by 10
26 translations
Loading...
Increment Counterbothcounters
Increment a numeric counter element
on click increment #counter
26 translations
Loading...
Inline JavaScriptbothadvanced
Execute inline JavaScript
on click js console.log("from js") end
26 translations
Loading...
Input Mirrorbothforms
Mirror input value to another element
on input put my value into #preview
26 translations
Loading...
Input Validationbothforms
Validate input on blur
on blur if my value is empty add .error to me else remove .error from me end
26 translations
Loading...
Install Behaviorbothbehaviors
Install a reusable behavior on an element. Replace "Draggable" with any defined behavior name (e.g., Sortable, Closeable).
install Draggable
26 translations
Loading...
Its Value (Possessive Dot)lokascripthyperfixi-extensions
Access result property using its.property syntax (HyperFixi extension)
on click fetch /api/data then put its.name into #result
26 translations
Loading...
Key Combinationbothevents
Handle Shift+Enter key combo
on keydown[key=="Enter"] if event.shiftKey call submitAndContinue() end
26 translations
Loading...
Last In Collectionbothnavigation
Scroll to last message in chat
on click scroll to last <.message/> in #chat
26 translations
Loading...
Log Elementbothdebugging
Log the current element to console
on click log me
26 translations
Loading...
Log Valuebothdebugging
Log a message to the console
on click log "Button clicked!"
26 translations
Loading...
Make Elementbothdom-manipulation
Create a new element dynamically
on click make a <div.card/> then put it into #container
Safe property access using optional chaining (HyperFixi extension)
on click log my?.dataset?.customValue
26 translations
Loading...
Prevent Form Submitbothforms
Prevent form submission and validate
on submit halt the event call validateForm() if result is false log "Invalid form" end
26 translations
Loading...
Previous Elementbothnavigation
Select and modify previous sibling element
on click remove .highlight from previous <li/>
26 translations
Loading...
Put Afterbothdom-manipulation
Insert content after the current element
on click put "<p>New</p>" after me
26 translations
Loading...
Put Beforebothdom-manipulation
Insert content before the current element
on click put "<p>New</p>" before me
26 translations
Loading...
Put Contentbothdom-manipulation
Replace the content of the current element
on click put "Done!" into me
26 translations
Loading...
Removable Behaviorbothbehavior
Removes element on click with optional confirmation and fade effect. Use: install Removable(confirmRemoval: true, effect: "fade")
behavior Removable(triggerEl, confirmRemoval, effect)
init
if triggerEl is undefined
set triggerEl to me
end
end
on click from triggerEl
if confirmRemoval
js(me)
if (!window.confirm("Are you sure?")) return "cancel";
end
if it is "cancel"
halt
end
end
trigger removable:before
if effect is "fade"
transition opacity to 0 over 300ms
end
trigger removable:removed
remove me
end
end
Remove Classbothclass-manipulation
Remove a CSS class from the current element when clicked
on click remove .highlight from me
26 translations
Loading...
Remove Class From Allbothclass-manipulation
Remove a CSS class from all matching elements
on click remove .active from .items
26 translations
Loading...
Remove Elementbothdom-manipulation
Remove the current element from the DOM
on click remove me
26 translations
Loading...
Repeat For Eachbothloops
Iterate over a collection
on click repeat for item in .items add .processed to item
26 translations
Loading...
Repeat Foreverbothloops
Infinite animation loop
on load repeat forever toggle .pulse wait 1s end
26 translations
Loading...
Repeat Timesbothloops
Repeat an action multiple times
on click repeat 3 times add "<p>Line</p>" to me
26 translations
Loading...
Repeat Until Eventbothloops
Repeat action while button is held
on mousedown repeat until event mouseup increment #counter wait 100ms end
26 translations
Loading...
Repeat While Conditionbothloops
Repeat while condition is true
on click repeat while #counter.innerText < 10 increment #counter wait 200ms end
26 translations
Loading...
Resizable Behaviorbothbehavior
Makes elements resizable by dragging. Use: install Resizable(minWidth: 100, minHeight: 100)
behavior Resizable(handle, minWidth, minHeight, maxWidth, maxHeight)
init
if handle is undefined
set handle to me
end
if minWidth is undefined
set minWidth to 50
end
if minHeight is undefined
set minHeight to 50
end
if maxWidth is undefined
set maxWidth to 9999
end
if maxHeight is undefined
set maxHeight to 9999
end
end
on pointerdown(clientX, clientY) from handle
halt the event
trigger resizable:start
measure width
set startWidth to it
measure height
set startHeight to it
set startX to clientX
set startY to clientY
repeat until event pointerup from document
wait for pointermove(clientX, clientY) or pointerup from document
js(startWidth, startHeight, clientX, clientY, startX, startY, minWidth, maxWidth, minHeight, maxHeight, me)
var nw = Math.max(minWidth, Math.min(maxWidth, startWidth + (clientX - startX)));
var nh = Math.max(minHeight, Math.min(maxHeight, startHeight + (clientY - startY)));
me.style.width = nw + 'px';
me.style.height = nh + 'px';
end
trigger resizable:resize
end
trigger resizable:end
end
end
Resize Handlerbothwindow-events
Handle window resize with debounce
on resize from window debounced at 200ms call adjustLayout()
26 translations
Loading...
Screen Reader Announcementbothaccessibility
Announce message to screen readers
on success put event.detail.message into #sr-announce set @role to "alert" on #sr-announce
26 translations
Loading...
Scroll Handlerbothwindow-events
Add sticky class on scroll
on scroll from window if window.scrollY > 100 add .sticky to #header else remove .sticky from #header end
26 translations
Loading...
Send Custom Eventbothevents
Dispatch a custom event to another element
on click send refresh to #widget
26 translations
Loading...
Send Event With Detailbothevents
Send an event with data payload
on click send update(value: 42) to #target
26 translations
Loading...
Set Attributebothdom-manipulation
Set an attribute on the current element
on click set @disabled to true
26 translations
Loading...
Set CSS Variablebothcss-styles
Set a CSS custom property
on click set the *--primary-color of #theme to "#ff6600"
26 translations
Loading...
Set Opacitybothcss-styles
Set CSS opacity using possessive syntax
on click set my *opacity to 0.5
26 translations
Loading...
Set Stylebothdom-manipulation
Set a CSS style property
on click set my *background to "red"
26 translations
Loading...
Set Text (Possessive Dot)lokascripthyperfixi-extensions
Set text content using possessive dot notation (HyperFixi extension)
on click set my.textContent to "Done!"
26 translations
Loading...
Set Text Contentbothdom-manipulation
Set the text content of an element by ID
on click set #output.innerText to "Hello World"
26 translations
Loading...
Set Transformbothcss-styles
Set CSS transform property
on click set my *transform to "rotate(45deg)"
26 translations
Loading...
Set innerHTML (Possessive Dot)lokascripthyperfixi-extensions
Set innerHTML using possessive dot notation (HyperFixi extension)
on click set my.innerHTML to "<strong>Updated!</strong>"
26 translations
Loading...
Settle Animationsbothanimation
Wait for CSS animations to complete
on click add .animate then settle then remove .animate
26 translations
Loading...
Show Elementbothvisibility
Show a hidden element
on click show #modal
26 translations
Loading...
Show With Transitionbothvisibility
Show element with opacity transition
on click show #modal with *opacity
26 translations
Loading...
Slide Togglebothanimation
Slide panel open/closed
on click toggle .collapsed on next .panel transition *max-height over 300ms
26 translations
Loading...
Sortable Behaviorbothbehavior
Makes child elements reorderable via drag-and-drop. Use: install Sortable(handle: ".drag-handle")
behavior Sortable(handle, dragClass)
init
if dragClass is undefined
set dragClass to "sorting"
end
end
on pointerdown(clientY) from me
js(me, handle, event)
var target = event.target;
var item = target.closest("li");
if (!item || !me.contains(item)) return false;
if (handle && !target.closest(handle)) return false;
event.preventDefault();
event.stopPropagation();
return true;
end
if it is false
exit
end
add .{dragClass} to me
trigger sortable:start on me
repeat until event pointerup from document
wait for pointermove(clientY) from document
trigger sortable:move on me
end
remove .{dragClass} from me
trigger sortable:end on me
end
end
Stagger Animationbothanimation
Staggered entrance animation
on load repeat for item in .item with index add .visible to item wait 100ms end
26 translations
Loading...
Swap Contentbothdom-manipulation
Swap two elements in the DOM
on click swap #a with #b
26 translations
Loading...
Tab Navigationbothui-components
Basic tab switching with active state
on click remove .active from .tab add .active to me
26 translations
Loading...
Tab With Content Panelbothui-components
Tab that shows associated content panel
on click remove .active from .tab add .active to me hide .tab-panel show the next <div.tab-panel/>
26 translations
Loading...
Tell Commandbothbehaviors
Tell another element to execute a command
on click tell #modal to show
26 translations
Loading...
Toggle ARIA Expandedbothaccessibility
Toggle ARIA expanded state
on click toggle @aria-expanded on me toggle .open on next .panel
26 translations
Loading...
Toggle Classbothclass-manipulation
Toggle a CSS class on the current element when clicked
on click toggle .active
26 translations
Loading...
Toggle Class On Other Elementbothclass-manipulation
Toggle a CSS class on another element
on click toggle .open on #menu
26 translations
Loading...
Toggle Visibilitybothvisibility
Toggle the hidden attribute on an element
on click toggle @hidden on #panel
26 translations
Loading...
Transition Background Colorbothcss-styles
Animate background color change
on click transition *background-color to "blue" over 500ms
26 translations
Loading...
Transition Opacitybothanimation
Animate opacity then remove the element
on click transition opacity to 0 over 500ms then remove me
26 translations
Loading...
Transition Transformbothanimation
Animate transform property
on click transition transform to "scale(1.2)" over 300ms
26 translations
Loading...
Trigger Eventbothevents
Trigger a custom event when the element loads
on load trigger init
26 translations
Loading...
Two-Way Bindingbothdata
Update display as input changes
on input from #firstName set #greeting.innerText to "Hello, " + my value
26 translations
Loading...
Unless Conditionbothcontrol-flow
Execute unless condition is true
on click unless I match .disabled toggle .selected
26 translations
Loading...
Wait For Eventbothtiming
Wait for a DOM event to fire
on click wait for transitionend
26 translations
Loading...
Wait Then Executebothtiming
Wait for a duration before executing a command
on click wait 2s then remove me
26 translations
Loading...
Window Keydown Handlerbothwindow-events
Handle Ctrl+S globally
on keydown[key=="s"] from window if event.ctrlKey halt call saveDocument() end