Skip to main content
Copy for LLM

Events

A dispatched event name is public API. Once you listen for one, renaming it breaks your code — so this page lists every event the catalog dispatches, not a curated selection, and says plainly which of them are on a convention we intend to keep.

For opening and closing overlays, Overlay Events is the deeper reference: it carries the payload shapes and the Livewire-side dispatch examples. This page is the complete inventory.

The convention

wirekit:<component>-<happening> — a colon after the namespace, hyphens inside the name.

window.addEventListener('wirekit:tab-changed', (e) => console.log(e.detail));

The colon is not decoration. It separates the namespace from the name the way <x-wirekit::button> does, and it cannot be mistaken for a CSS class or a hyphenated HTML attribute — which a bare wirekit-tab-changed can. Where a name has a natural sub-scope, a second colon groups it: wirekit:reading-progress:milestone.

Every component works on its own. These events exist so your application can react to what a component did, if it wants to — a listener is an addition, not a prerequisite.

Listening from Alpine

Reacting to a tab change

Overview panel.

Activity panel.

Settings panel.

Key of the last tab:

The event carries the tab's key as tab and its label as label. A Livewire component hears it through a listener on an element around the tabs that hands $event.detail.tab to one of its methods, as Tabs shows.

Two directions

Some events WireKit dispatches — you add a listener and react. Others WireKit listens for — you dispatch them to drive a component. The tables below are the first kind. The second kind is almost entirely the overlay vocabulary (wirekit-modal-show, wirekit-drawer-close, wirekit-alert-dialog-close and their siblings), and it lives in Overlay Events with the payload each one expects.

If you are looking for "how do I open a modal from Livewire", that is the other page.

Outside the overlays, a component that listens for an event documents it on its own page:

  • wirekit:address-changed, on window, tells every navigation with track-current that a script wrote the address: Sidebar.
  • wirekit:external-links-trust, on window, with hosts in its detail, adds hosts the question before a link to another site leaves alone while the page stands: External Link Question.
  • wirekit:file-upload-reset empties a file upload: File Upload.
  • wirekit:card-open and wirekit:card-close open and fold a collapsible card: Card.
  • wirekit:captcha-reset, on window, with name in its detail for one captcha, starts a new check and empties its field once your server has checked a token: Captcha.
  • wirekit:focus, on window, with target in its detail, takes the focus to the element it names once the response is written: Button.
  • wirekit:focus-invalid takes the focus to the first rejected field and opens the card, the wizard step or the panel around it: Form.
  • wirekit:reveal starts every reveal whose trigger is manual: Reveal.
  • wirekit:shortcuts-open opens the overview of the keyboard shortcuts: Shortcuts.
  • wirekit:saved tells x-wk-unsaved that a save went through, and wirekit:not-saved that one did not: Unsaved Hint and A Save That Did Not Go Through.
  • wirekit:unsaved-release tells x-wk-unsaved.confirm to ask nothing more until the next page: Asking Before the Reader Leaves.

The full inventory of what WireKit dispatches

On the convention

These use the namespace and the colon, and they are the shape new events will take.

Event Dispatched by
wirekit:badge-dismissed badge, when the reader dismisses a dismissible one
wirekit:branch-switcher:change branch-switcher, when a move settles; current and total carry the position
wirekit:bulk-selection-change bulk-selection, when every match on all pages becomes selected or stops being selected; allMatches carries the state, see Bulk Selection
wirekit:card-open wirekit:focus-invalid, from the first rejected field, and wirekit:focus, from the element it names, so that every collapsible card around it opens. A page dispatches it too, see Card
wirekit:card-opened card with collapsible, once it stands open at its full height, after any way of opening it and in answer to wirekit:card-open when it was open already; name carries it, see Card
wirekit:card-toggled card with collapsible, when the reader opens or closes it with its head; name, persist and open carry it
wirekit:cart-decrement cart-item with stepper="buttons", on each press of −; item carries the line's key
wirekit:cart-increment cart-item with stepper="buttons", on each press of +; item carries the line's key
wirekit:cart-quantity cart-item with stepper="buttons", on two taps or a double click of the quantity; item carries the line's key
wirekit:cart-ask-remove cart-item, from its number field when − is pressed at the smallest quantity; the line asks whether it goes, or with confirmRemove off sends wirekit:cart-remove at once
wirekit:cart-remove cart-item
wirekit:cart-remove-confirmed cart-item, when the line's question whether it goes, asked by its remove control or by − at the smallest quantity, is answered with "Remove"; question names it, and the line's remove control then sends wirekit:cart-remove from inside the line
wirekit:combobox-choose combobox with free-input, when the reader takes a suggestion; value, label and option (its data included) carry it
wirekit:command-palette-page command-palette, when the reader opens a page or goes back from one; page names the open page, null on the top level, and name the palette, see Command Palette with Pages
wirekit:command-palette-submit command-palette, on Enter with nothing highlighted; query carries what was typed, page the open page
wirekit:copied code-block and clipboard-button, after each copy; succeeded says whether the clipboard took the text
wirekit:data-table-columns-changed data-table, when the reader shows or hides a column; hidden and visible carry the keys
wirekit:date-picker-clear date-picker with popover and clearable, when the reader empties it, see Date Picker
wirekit:date-picker-close date-picker with popover, when its dialog closes, however it closes
wirekit:date-picker-open date-picker with popover, when its dialog opens
wirekit:datetime-picker-clear datetime-picker with clearable, when the reader empties it, see Datetime Picker
wirekit:datetime-picker-close datetime-picker, when its dialog closes, however it closes
wirekit:datetime-picker-open datetime-picker, when its dialog opens
wirekit:drawer-dismissed drawer, when the reader dismisses it
wirekit:event-calendar-day-select event-calendar with selectableDays, when the reader picks a day; date and eventIds carry it
wirekit:external-link-trusted external-link-question, on window, when the reader visits a host with "Don't warn me about links to … again" checked; host carries it, see External Link Question
wirekit:field-help every field, table head and heading with help, when the reader clicks its question mark; name and label carry the field, the column or the heading's id, and the text beside the mark
wirekit:hover-card-opened hover-card, once per opening, rising from the card, so its content can load when it opens; see Hover Card
wirekit:image-compare-slide image-compare
wirekit:image-editor-change image-editor, when the reader moved or sized the crop, or with tools drew, moved, sized, recolored or removed a mark: at the end of a drag, on a key press, a field's change, a button, an undo or a redo; crop carries it, and with tools marks as well, see Image Editor
wirekit:image-editor-error image-editor, when rasterize() could not read or draw the image; error carries it, see Image Editor
wirekit:image-editor-result image-editor, when rasterize() drew the edit into a file; file, crop and marks carry it, see Image Editor
wirekit:image-hotspots-select image-hotspots, when the reader presses a marker; index, target and label carry it, see Image Hotspots
wirekit:image-hotspots-editor-select image-hotspots-editor, when the reader selects a point, sets one or adds one; index and point carry it, see Image Hotspots Editor
wirekit:inline-edit-confirmed inline-edit
wirekit:inline-edit-opened inline-edit
wirekit:input-cleared input, when the reader clears a clearable field; name carries the field's name
wirekit:modal-dismissed modal, when the reader dismisses it
wirekit:notification-delete-read-confirmed notification-center with delete-read, when its question before Delete read is answered with "Delete read"; question names it, and the panel then takes the read notifications out and sends notification-delete-read
wirekit:otp-complete otp-input
wirekit:quick-replies-select quick-replies, when the reader picks a reply; value, label and index carry it
wirekit:rail:toggled app-rail
wirekit:reading-bookmark:cleared reading-bookmark, on window, when the reader is back at the top; key names the bookmark
wirekit:reading-bookmark:saved reading-bookmark, on window, when it saves the reader's place; key, top and dwell carry it
wirekit:reading-progress:milestone reading-progress
wirekit:reading-spine:section-changed reading-spine
wirekit:replayed replay-button
wirekit:shortcuts-open shortcuts-trigger, on window, asking the overview of the keyboard shortcuts to open; you can send it yourself, see Shortcuts
wirekit:shortcuts-single-keys-changed shortcuts, on window, when the reader flips the switch for single-key shortcuts; enabled carries it, see Shortcuts
wirekit:sidebar:toggle sidebar-collapse-toggle, on window, asking the sidebar whose id it names to fold, or every sidebar when it names none; you can send it yourself, see Sidebar
wirekit:sidebar:toggled sidebar-rail, on window, on every change and once on init; id, collapsed, chosenCollapsed and cause (init, toggle or viewport) carry it, see Sidebar
wirekit:sortable:moved sortable, when a card moves to another list; id, from and to carry the move
wirekit:sortable:reordered sortable
wirekit:tab-changed tabs
wirekit:table-search table.search, on each change of the query, with server once the answer to it is rendered; query, matches and total carry it, see Table
wirekit:theme-changed theme-controller
wirekit:time-picker-clear time-picker with popover and clearable, when the reader empties it, see Time Picker
wirekit:time-picker-close time-picker with popover, when its dialog closes, however it closes
wirekit:time-picker-open time-picker with popover, when its dialog opens
wirekit:unsaved x-wk-unsaved, on window, when the page gains its first unsaved field or loses its last; unsaved carries it, see Unsaved Hint
wirekit:unsaved-question x-wk-unsaved.confirm, on the scope that asks, bubbling, just before its question opens; a listener may set question, description, leave and shortcut in the detail, which also carries fields, see Unsaved Hint
wirekit:video-consent video, when the reader presses "Load the video" on a video from YouTube or Vimeo; name and provider carry it, and canceling it hands the question to your consent manager, see Video

Namespaced with a hyphen

Older, and every one of them keeps working unchanged for the whole of v2 — the names below are the contract. They are listed apart because a new event will not be named this way.

Event Dispatched by
wirekit-alert-dialog-show cart-item, when − at the smallest quantity asks whether the line goes
wirekit-command-palette-query command-palette; query carries the field, page the open page
wirekit-command-palette-show command-palette.trigger
wirekit-countdown-expired countdown
wirekit-drawer-show drawer.trigger
wirekit-modal-close shortcuts, closing its overview when ? is pressed again
wirekit-modal-show modal.trigger, when it is given a for
wirekit-overlay-stack-changed the overlay stack
wirekit-stream-event stream
wirekit-toast toast
wirekit-toast-{name} toast, scoped to one region

wirekit-toast-{name} is assembled at runtime from the region's name, so a search of the package's scripts for the full name of one region's event finds nothing.

wirekit-alert-dialog-show, wirekit-modal-show, wirekit-modal-close, wirekit-drawer-show and wirekit-command-palette-show are the five names in this table that appear on both sides of the page. Each is an event you dispatch at its component, which is what Overlay Events documents. They are listed here as well because a <x-wirekit::modal.trigger for="…">, a <x-wirekit::drawer.trigger for="…"> and a <x-wirekit::command-palette.trigger> send them for you, <x-wirekit::shortcuts> closes its overview with wirekit-modal-close, and a cart line opens its question with wirekit-alert-dialog-show, so the library emits them too. One happening, one name: a trigger has to say the word its listener answers to, and a second spelling for the same thing would cost every reader the question of which one is real.

Without a namespace

These eleven carry no prefix at all, and four of them — slide, selection-change, sort-change, view-change — are generic enough to collide with an event from your own application or another library, slide above all. A collision fails silently: both listeners run, and the wrong one may act on a payload it did not expect. Do not listen for these on window; scope the listener to the component's own element.

Event Dispatched by
cell-change status-matrix
conversation-reached-top conversation
event-click event-calendar
filter-change filter-builder
marker-click map
search-change data-table, filter-builder, multi-select and combobox in server mode
selection-change data-table
slide image-compare — and the component re-dispatches it as the namespaced wirekit:image-compare-slide, so both names reach you
sort-change data-table
tree-node-select tree-view
view-change event-calendar

They keep working for the whole of v2. Renaming them is a breaking change and belongs to a major version, alongside an alias period — not to a tidy-up.

Between WireKit's own instances

A few events carry a message from one instance of a component to another. A listener on window hears most of them, so they are named here, but they are wiring rather than something to build on: their names and payloads are not part of the promise at the top of this page. To react to what they coordinate, listen for the component's own event in the tables above.

Event Used by
wirekit:combobox-open combobox: opening one closes the others
wirekit:context-menu-open context-menu: opening one closes the others
wirekit:dropdown-open dropdown: opening one closes the others
wirekit:hls-engine registerHlsEngine(), so a video that mounted before its engine arrived can play
wirekit:hover-card-open hover-card: opening one closes the others
wirekit:map-engine registerMapEngine(), so a map that mounted before its engine arrived can start
wirekit:menubar-open menubar: opening one closes the others
wirekit:navigation-menu-open navigation-menu: opening one closes the others
wirekit:popover-open popover: opening one closes the others
wirekit:sortable:receive sortable, handing a card to another list; sent to that list only, and it does not bubble
wirekit:sortable:reorder sortable on a kanban board: the list whose column turned reorder mode on or off tells the other lists; sent to the board only, and it does not bubble
wirekit:sortable:reorder-state sortable, telling its column's Reorder button whether the mode is on; sent to that button only, and it does not bubble
wirekit:sortable:reorder-toggle kanban column: a press on its Reorder button, heard by the column's list
wirekit:unsaved-leave unsaved-hint: Leave in the dialog that asks before a wire:navigate visit or an ordinary link, heard by x-wk-unsaved.confirm, which goes on with the visit

What this means for your code

  • Listening is safe. Every name on this page is stable for v2.
  • Prefer scoping to the element over window for the events without a namespace, because those are the ones that can collide.
  • Writing your own component? Give its events a namespace of your own rather than wirekit:, for exactly the reason this page exists.

Was this page helpful?

Thank you for your feedback!

Voting requires cookies or local storage. What we store