# Events

> Plainkit 0.28.0. Generated by scripts/build-skills.mjs from Generated/PkGeneratedEvents.cs. Do not edit: change the source and run the generator.

An event with a detail gives `EventCallback<PkXxxEventArgs>`; the args class has one nullable property per field of the element's detail (set only when the element sends it). An event with no detail gives `EventCallback`; `click` gives `MouseEventArgs`. A change event that drives a value is also exposed as a two-way `@bind-` parameter. **Every** `pk-*` event of every element is registered with Blazor and mapped to its args class (the generated `EventHandlers` class; Razor only finds a class with that exact name), so raw markup works too: `<pk-table @onpk-sort="OnSort">` with `void OnSort(PkSortEventArgs e)`, no JavaScript needed (add `@using PlainKit.Blazor`).

**Calling element methods.** The mapped elements expose their documented methods as awaitable calls on an `@ref` to the component: `await _dialog.ShowAsync()` / `HideAsync()` / `ToggleAsync()` (dialog, drawer, popover, tooltip, select-menu, split-button, dropdown, tray, combobox, ...), `await _input.FocusAsync()` (input, select, textarea, checkbox, range, rating, ...), `await _table.RefreshAsync()`, `await _lightbox.ShowAsync(index)`, `await _menu.ShowAtAsync(x, y)`, `bool ok = await _form.ValidateAllAsync()`, `_fieldGroup.FocusFieldAsync(key)` / `SetErrorAsync(key, message)`, `_toastStack.PushAsync(toast)`. Any other method of the element: `await _el.CallAsync("name", arg1, arg2)` or `CallAsync<T>(...)` (arguments and results travel as JSON, camelCase). A method the element lacks does nothing; a call made before the element is defined waits for it. Each call needs the component to have rendered (the `@ref` is set after the first render), so call from an event handler or `OnAfterRenderAsync`, not `OnInitialized`. Static helpers (`PkDialog.confirm`: use `IPkDialogs`), properties and methods taking nodes or functions are not wrapped.

| Element event | Args class | Raised by | Fields |
|---|---|---|---|
| `pk-action` | `PkActionEventArgs` | `PkDashboardPage` `PkMasterDetailPage` `PkRecordPage` `PkSettingsPage` `PkToolPage` `PkWizardPage` `PkWorkspacePage` | Key: string? |
| `pk-activate` | `PkActivateEventArgs` | `PkStat` | Href: string? |
| `pk-add` | `PkAddEventArgs` | `PkImageGallery` | Files: PkFileInfo[]?, Names: string[]? |
| `pk-bulk` | `PkBulkEventArgs` | `PkListPage` | Action: string?, Selected: string[]?, Scope: string?, Query: JsonElement? |
| `pk-canvas-key` | `PkCanvasKeyEventArgs` | `PkCanvas` | Key: string?, ShiftKey: bool?, AltKey: bool?, CtrlKey: bool? |
| `pk-canvas-move` | `PkCanvasMoveEventArgs` | `PkCanvas` | Moves: JsonElement?, Done: bool? |
| `pk-canvas-pick` | `PkCanvasPickEventArgs` | `PkCanvas` | Target: JsonElement?, Additive: bool? |
| `pk-canvas-resize` | `PkCanvasResizeEventArgs` | `PkCanvas` | Id: string?, X: double?, Y: double?, W: double?, H: double?, Done: bool? |
| `pk-canvas-select` | `PkCanvasSelectEventArgs` | `PkCanvas` | Ids: string[]? |
| `pk-cell-edit` | `PkCellEditEventArgs` | `PkTable` | Id: string?, Index: double?, Row: JsonElement?, Key: string?, Value: JsonElement?, Previous: JsonElement?, Source: string?, Wait: JsonElement? |
| `pk-cell-query` | `PkCellQueryEventArgs` | `PkTable` | Id: string?, Key: string?, Query: string? |
| `pk-cells-paste` | `PkCellsPasteEventArgs` | `PkTable` | Cells: JsonElement?, Rejected: JsonElement? |
| `pk-change` | `PkChangeEventArgs` | `PkCheckbox` `PkLightbox` `PkMarkdownEditor` `PkSelectMenu` `PkSwitch` | Checked: bool?, Index: double?, Value: string?, Label: string?, Previous: string? |
| `pk-close` | `PkCloseEventArgs` | `PkBadgePopover` `PkCardMenu` `PkCommandPalette` `PkContextMenu` `PkDialog` `PkDrawer` `PkDropdown` `PkLightbox` `PkPopover` `PkSelectMenu` `PkSideNav` `PkTray` | Reason: string? |
| `pk-collapse-change` | `PkCollapseChangeEventArgs` | `PkSplitter` | Collapsed: bool? |
| `pk-colour` | `PkColourEventArgs` | `PkColourInput` | Value: string? |
| `pk-column-reorder` | `PkColumnReorderEventArgs` | `PkTable` | Key: string?, From: double?, To: double?, Order: string[]? |
| `pk-column-resize` | `PkColumnResizeEventArgs` | `PkTable` | Key: string?, Width: double? |
| `pk-combo-query` | `PkComboQueryEventArgs` | `PkCombobox` | Query: string? |
| `pk-combo-select` | `PkComboSelectEventArgs` | `PkCombobox` | Value: string?, Label: string? |
| `pk-combo-toggle` | `PkComboToggleEventArgs` | `PkCombobox` | Open: bool? |
| `pk-copy` | `PkCopyEventArgs` | `PkCodeBlock` `PkCodeView` | Ok: bool? |
| `pk-dismiss` | `PkDismissEventArgs` | `PkToast` | Reason: string? |
| `pk-field-action` | `PkFieldActionEventArgs` | `PkFieldGroup` | Key: string?, Action: string? |
| `pk-field-change` | `PkFieldChangeEventArgs` | `PkFieldGroup` | Key: string?, Value: JsonElement?, Values: JsonElement? |
| `pk-files` | `PkFilesEventArgs` | `PkDropzone` | Count: double?, RejectedCount: double? |
| `pk-filter` | `PkFilterEventArgs` | `PkTable` | Filters: Dictionary<string, string>? |
| `pk-frame-resize` | `PkFrameResizeEventArgs` | `PkFrame` | Height: double? |
| `pk-heat-focus-item` | `PkHeatFocusItemEventArgs` | `PkHeatMap` | Id: string? |
| `pk-heat-select` | `PkHeatSelectEventArgs` | `PkHeatMap` | Id: string? |
| `pk-invalid` | `PkInvalidEventArgs` | `PkForm` | Count: double? |
| `pk-layout-change` | `PkLayoutChangeEventArgs` | `PkDock` | Layout: JsonElement?, Reason: string? |
| `pk-line-click` | `PkLineClickEventArgs` | `PkCodeView` | Line: double?, Column: double? |
| `pk-link-click` | `PkLinkClickEventArgs` | `PkMarkdown` | Href: string? |
| `pk-load-error` | `PkLoadErrorEventArgs` | `PkDataTable` | Error: JsonElement? |
| `pk-lookup-select` | `PkLookupSelectEventArgs` | `PkLookupPicker` | Value: string?, Label: string?, Row: JsonElement? |
| `pk-lookup-toggle` | `PkLookupToggleEventArgs` | `PkLookupPicker` | Open: bool? |
| `pk-menu-toggle` | `PkMenuToggleEventArgs` | `PkSplitButton` | Open: bool? |
| `pk-month` | `PkMonthEventArgs` | `PkCalendar` | Month: string? |
| `pk-move` | `PkMoveEventArgs` | `PkKanban` | Item: string?, From: string?, To: string?, FromIndex: double?, ToIndex: double? |
| `pk-navigate` | `PkNavigateEventArgs` | `PkDataTable` `PkDocPage` `PkLink` `PkTable` `PkTreeItem` | To: string?, Href: string?, Id: string?, Anchor: string?, Replace: bool? |
| `pk-nav-toggle` | `PkNavToggleEventArgs` | `PkAppShell` `PkSideNav` | Open: bool?, Hidden: bool?, Collapsed: bool? |
| `pk-open` | `PkOpenEventArgs` | `PkContextMenu` `PkMedia` `PkTray` | X: double?, Y: double?, Target: JsonElement?, Context: string?, Src: string?, Alt: string?, Caption: string?, Reason: string? |
| `pk-otp-change` | `PkOtpChangeEventArgs` | `PkOtpInput` | Value: string? |
| `pk-otp-complete` | `PkOtpCompleteEventArgs` | `PkOtpInput` | Value: string? |
| `pk-page` | `PkPageEventArgs` | `PkPagination` | Page: double? |
| `pk-page-size` | `PkPageSizeEventArgs` | `PkPagination` | PageSize: double? |
| `pk-pane-change` | `PkPaneChangeEventArgs` | `PkWorkspace` | Pane: string?, Previous: string? |
| `pk-pause` | `PkPauseEventArgs` | `PkLog` | Paused: bool? |
| `pk-primary-change` | `PkPrimaryChangeEventArgs` | `PkImageGallery` | Index: double?, Src: string?, Previous: double? |
| `pk-property-change` | `PkPropertyChangeEventArgs` | `PkPropertyGrid` | Key: string?, Value: JsonElement?, Values: JsonElement?, Valid: bool? |
| `pk-query-change` | `PkQueryChangeEventArgs` | `PkDataTable` | SortKey: string?, Descending: bool?, Search: string?, Page: double?, PageSize: double?, Filters: JsonElement? |
| `pk-query` | `PkQueryEventArgs` | `PkAppBarSearch` `PkAppFrame` | Query: string? |
| `pk-range-change` | `PkRangeChangeEventArgs` | `PkCalendar` `PkDateRangePicker` | Start: string?, End: string?, Valid: bool?, Preset: string? |
| `pk-range` | `PkRangeEventArgs` | `PkRange` | Value: double?, Low: double?, High: double? |
| `pk-rating-change` | `PkRatingChangeEventArgs` | `PkRating` | Value: double? |
| `pk-record-cancel` | `PkRecordCancelEventArgs` | `PkRecordPage` | Id: string? |
| `pk-record-change` | `PkRecordChangeEventArgs` | `PkRecordPage` | Key: string?, Value: JsonElement?, Values: JsonElement? |
| `pk-record-delete` | `PkRecordDeleteEventArgs` | `PkRecordPage` | Id: string? |
| `pk-record-dirty` | `PkRecordDirtyEventArgs` | `PkRecordPage` | Dirty: bool? |
| `pk-remove` | `PkRemoveEventArgs` | `PkImageGallery` `PkTag` | Index: double?, Src: string?, Value: string? |
| `pk-reorder` | `PkReorderEventArgs` | `PkImageGallery` `PkSortable` | Order: string[]?, From: double?, To: double?, Item: string?, External: bool?, Payload: JsonElement? |
| `pk-resize` | `PkResizeEventArgs` | `PkSplitter` | Size: double? |
| `pk-row-click` | `PkRowClickEventArgs` | `PkListPage` `PkTable` `PkDataTable` | Id: string?, Row: JsonElement? |
| `pk-row-expand` | `PkRowExpandEventArgs` | `PkDataTable` `PkListPage` `PkTable` | Id: string?, Index: double?, Expanded: bool? |
| `pk-search` | `PkSearchEventArgs` | `PkInput` `PkTableFilters` | Value: string?, Query: string? |
| `pk-section-change` | `PkSectionChangeEventArgs` | `PkDetailLayout` `PkToc` | Section: string?, Previous: string?, Id: string? |
| `pk-select-all` | `PkSelectAllEventArgs` | `PkTable` | Scope: string?, Count: double? |
| `pk-select` | `PkSelectEventArgs` | `PkAppBarSearch` `PkAppFrame` `PkCalendar` `PkCardMenu` `PkCommandPalette` `PkContextMenu` `PkDropdown` `PkListPage` `PkMenuItem` `PkTable` `PkTree` `PkTreeItem` `PkDataTable` | Item: JsonElement?, Value: string?, Checked: bool?, Id: string?, Selected: string[]?, Scope: string?, Query: JsonElement? |
| `pk-size-change` | `PkSizeChangeEventArgs` | `PkTray` | Size: string? |
| `pk-sortable-drag` | `PkSortableDragEventArgs` | `PkSortableItem` | X: double?, Y: double? |
| `pk-sortable-drop` | `PkSortableDropEventArgs` | `PkSortableItem` | Cancelled: bool? |
| `pk-sortable-grab` | `PkSortableGrabEventArgs` | `PkSortableItem` | X: double?, Y: double? |
| `pk-sort` | `PkSortEventArgs` | `PkTable` | Key: string?, Direction: string? |
| `pk-split-select` | `PkSplitSelectEventArgs` | `PkSplitButton` | Value: string?, Label: string? |
| `pk-step-change` | `PkStepChangeEventArgs` | `PkStepper` | Index: double?, Previous: double? |
| `pk-submenu-toggle` | `PkSubmenuToggleEventArgs` | `PkMenuItem` | Open: bool? |
| `pk-submit` | `PkSubmitEventArgs` | `PkAppBarSearch` | Query: string? |
| `pk-surface-hover` | `PkSurfaceHoverEventArgs` | `PkDesignSurface` | Target: JsonElement? |
| `pk-surface-key` | `PkSurfaceKeyEventArgs` | `PkDesignSurface` | Key: JsonElement?, ShiftKey: JsonElement?, AltKey: JsonElement?, CtrlKey: JsonElement? |
| `pk-surface-pick` | `PkSurfacePickEventArgs` | `PkDesignSurface` | Target: JsonElement?, Additive: JsonElement? |
| `pk-tab-change` | `PkTabChangeEventArgs` | `PkPageHeader` `PkTabs` | Value: string?, Previous: string?, Fallback: bool? |
| `pk-tab-close` | `PkTabCloseEventArgs` | `PkTab` | Value: string? |
| `pk-tags-change` | `PkTagsChangeEventArgs` | `PkTagInput` | Value: string?, Values: string[]? |
| `pk-toggle` | `PkToggleEventArgs` | `PkAccordionItem` `PkAppBarSearch` `PkButton` `PkHint` `PkNavItem` `PkNavbar` `PkTableFilters` `PkTree` `PkTreeItem` | Open: bool?, Expanded: bool?, Pressed: bool?, Value: string?, Id: string? |
| `pk-value-change` | `PkValueChangeEventArgs` | `PkInput` `PkRadioGroup` `PkSelect` `PkTextarea` `PkUnitInput` | Value: string?, Values: string[]? |
| `pk-values-change` | `PkValuesChangeEventArgs` | `PkLookupPicker` | Values: string[]?, Labels: string[]? |
| `pk-view-change` | `PkViewChangeEventArgs` | `PkCanvas` | X: double?, Y: double?, Zoom: double? |
| `pk-wizard-dirty` | `PkWizardDirtyEventArgs` | `PkWizardPage` | Dirty: bool? |
| `pk-wrap-change` | `PkWrapChangeEventArgs` | `PkCodeBlock` | Wrap: bool? |

Events without a detail (`pk-clear-filters` `pk-confirm` `pk-expand` `pk-frame-load` `pk-hide` `pk-load-more` `pk-page-shell-retry` `pk-record-save` `pk-reset` `pk-retry` `pk-show` `pk-theme-toggle` `pk-valid` `pk-wizard-submit`) use `EventArgs`.
