AppSurface Search
JavaScript API

RazorWire JavaScript API

JavaScript API

RazorWire JavaScript API

Public JavaScript contracts harvested from documented source comments.

JavaScript Global

window.RazorWire

Source

Browser global that exposes RazorWire runtime managers and runtime configuration for diagnostics and advanced integrations.

window.RazorWire
JavaScript Config Field

window.RazorWireIslandModules

Source

Optional island module manifest that maps logical `data-rw-module` names to host-provided module specifiers before RazorWire imports them.

window.RazorWireIslandModules
  • Type: {Record<string, string>}
  • Source: host page script or bundled app script

Properties

  • moduleName string - Logical island module name keyed by the value rendered in `data-rw-module`.
JavaScript Config Field

window.RazorWire.config

Source

Runtime configuration merged from the `<rw:scripts />` script tag.

window.RazorWire.config
  • Type: {object}
  • Source: <rw:scripts />

Properties

  • developmentDiagnostics boolean - Whether development diagnostics can be exposed.
  • failureUxEnabled boolean - Whether failed-form request markers, events, fallback rendering, and diagnostics are enabled.
  • failureMode "auto"|"manual"|"off" - Default failed-form behavior.
  • defaultFailureMessage string - Reader-facing fallback copy for unhandled form failures.
JavaScript Typedef

RazorWireBehaviorDefinition

Source

Behavior definition registered with the RazorWire Behavior Kit.

RazorWireBehaviorDefinition

Properties

  • name string - Stable behavior name. Names are immutable for the page lifetime; repeated registrations with the same selector are idempotent.
  • selector string - CSS selector for roots that should receive one connected behavior controller.
  • connect Function - Callback invoked once per matching connected root. It receives `(root, context)` and may return a cleanup function.
JavaScript Typedef

RazorWireLifecycleDefinition

Source

Page-lifecycle definition registered with the RazorWire Behavior Kit.

RazorWireLifecycleDefinition

Properties

  • name string - Stable lifecycle behavior name. Names are immutable for the page lifetime; repeated registrations with the same lifecycle options are idempotent.
  • [events] Array<"initial"|"turbo:load"|"turbo:render"> - Logical page lifecycle events that should run the behavior. Defaults to `["initial", "turbo:load"]`.
  • [frames] boolean - Set to `true` to run on `turbo:frame-load`; frame loads are ignored by default.
  • connect Function - Callback invoked for each matching lifecycle pass. It receives `context` and may return a cleanup function.
JavaScript Typedef

RazorWireBehaviorDiagnostic

Source

Diagnostic emitted by the RazorWire Behavior Kit.

RazorWireBehaviorDiagnostic

Properties

  • code RazorWireBehaviorDiagnosticCode - Stable diagnostic code.

    Type preview: RazorWireBehaviorDiagnosticCode - Stable Behavior Kit diagnostic codes.

  • message string - Required problem statement for the invalid registration or lifecycle failure.
  • impact string - Required explanation of the behavior RazorWire skipped, changed, or could not guarantee.
  • fix string - Required remediation guidance suitable for docs, tests, and development diagnostics.
  • docs string - Required repository documentation path for troubleshooting guidance.
  • [behaviorName] string - Behavior name associated with the diagnostic when available.
  • [rootId] string - Runtime-generated behavior/root identity when available.
JavaScript Config Field

window.RazorWire.behaviors

Source

Behavior Kit manager for app-authored progressive enhancement on replaceable server-rendered DOM and logical browser visits.

window.RazorWire.behaviors
  • Type: {object}
  • Source: <rw:scripts behavior-kit="true" />

Properties

  • register Function - Registers a root-scoped behavior definition with `name`, `selector`, and `connect(root, context)`.
  • registerLifecycle Function - Registers a page-lifecycle behavior definition with `name`, optional `events`, optional `frames`, and `connect(context)`.
  • scan Function - Re-scans the document or supplied root for registered behavior selectors.
  • prune Function - Disconnects controllers whose roots left the document or no longer match their selector.
  • getDiagnostics Function - Returns stable Behavior Kit diagnostics recorded since startup.
  • clearDiagnostics Function - Clears recorded Behavior Kit diagnostics.
JavaScript Typedef

RazorWireBehaviorContext

Source

Root-scoped Behavior Kit context passed to `window.RazorWire.behaviors.register(...).connect`.

RazorWireBehaviorContext

Properties

  • signal AbortSignal - Signal aborted before cleanup when RazorWire disconnects the root.
  • behaviorName string - Registered behavior name.
  • rootId string - Stable runtime identity for the current behavior/root pair.
  • query Function - Scoped `querySelector` helper rooted at the connected element.
  • queryAll Function - Scoped `querySelectorAll` helper rooted at the connected element.
  • diagnostic Function - Records an app-owned behavior diagnostic with a message and fix.
JavaScript Typedef

RazorWireLifecycleContext

Source

Page-lifecycle Behavior Kit context passed to `window.RazorWire.behaviors.registerLifecycle(...).connect`.

RazorWireLifecycleContext

Properties

  • signal AbortSignal - Signal aborted before cleanup when the lifecycle behavior reconnects on a later pass.
  • behaviorName string - Registered lifecycle behavior name.
  • url string - Current browser URL for the lifecycle pass.
  • renderKind "initial"|"turbo:load"|"turbo:render"|"turbo:frame-load" - Logical render lifecycle that triggered the pass.
  • root Document|Element - Document or frame element that owns the lifecycle pass.
  • diagnostic Function - Records an app-owned lifecycle diagnostic with a message and fix.
JavaScript Typedef

RazorWireBehaviorDiagnosticCode

Source

Stable Behavior Kit diagnostic codes.

RazorWireBehaviorDiagnosticCode
JavaScript Config Field

window.RazorWire.pageNavigationManager

Source

Page navigation manager for same-page section links, active state, optional collapsible panels, and lifecycle-safe rebinding.

window.RazorWire.pageNavigationManager
  • Type: {object}
  • Source: <rw:scripts /> with rendered `[data-rw-page-nav]` markup

Properties

  • scan Function - Re-scans the document for `[data-rw-page-nav]` roots after custom DOM updates.
  • prune Function - Removes controllers for disconnected roots.
  • refreshActiveFromHash Function - Recomputes active links from the current `window.location.hash`.
  • syncActiveLinkVisibility Function - Re-checks the current active link and reveals it inside the nearest visible vertical overflowing page-nav container without scrolling the document viewport.
  • getDiagnostics Function - Returns page navigation diagnostics recorded since startup.
  • clearDiagnostics Function - Clears recorded page navigation diagnostics.
JavaScript Config Field

window.RazorWire.sectionCopyManager

Source

Section copy manager for framework-neutral section permalink buttons, generated copy controls, clipboard fallback UI, and lifecycle-safe rebinding.

window.RazorWire.sectionCopyManager
  • Type: {object}
  • Source: <rw:scripts /> with rendered `[data-rw-section-copy]` or `[data-rw-section-copy-target]` markup

Properties

  • scan Function - Re-scans the document for section-copy roots and markers after custom DOM updates.
  • prune Function - Removes controllers for disconnected roots.
  • getDiagnostics Function - Returns an array of stable section-copy diagnostic objects recorded since startup.
  • getDiagnostics[].message string - Required reader-facing problem statement for the invalid marker or runtime state.
  • getDiagnostics[].impact string - Required explanation of the behavior RazorWire skipped, changed, or could not guarantee.
  • getDiagnostics[].fix string - Required remediation guidance suitable for docs, tests, and development diagnostics.
  • getDiagnostics[].docs string - Required repository documentation path for the related troubleshooting guidance.
  • clearDiagnostics Function - Clears recorded section copy diagnostics.
JavaScript Event

razorwire:form:submit-start

Source

A RazorWire-enhanced form started submitting through Turbo.

razorwire:form:submit-start
  • Target: form[data-rw-form="true"]
  • Fires when: Turbo begins submitting a RazorWire-enhanced form and RazorWire marks it busy.
  • Bubbles: true
  • Cancelable: false

Detail fields

  • detail.form HTMLFormElement - Submitted form.
  • detail.submitter HTMLElement|null - Button or submit control that initiated the submission.
JavaScript Event

razorwire:page-nav:active-change

Source

A RazorWire page navigation root changed its active link.

razorwire:page-nav:active-change
  • Target: [data-rw-page-nav]
  • Fires when: RazorWire promotes a same-page link to the active section from hash, scroll, or click state.
  • Bubbles: true
  • Cancelable: false

Detail fields

  • detail.link Element|null - Active link element, or null when no target link is active.
JavaScript Typedef

FormFailureDetail

Source

Failure payload passed through event.detail for a failed RazorWire-enhanced form submission.

FormFailureDetail

Properties

  • form HTMLFormElement - Submitted form.
  • submitter HTMLElement|null - Button or submit control that initiated the submission.
  • statusCode number|null - HTTP status code when available.
  • handled boolean - Whether the server response already handled the failure.
  • responseKind "turbo-stream"|"html"|"json"|"unknown"|"network" - Failure category.
  • target Element - Stream target or form that should own the failure UI.
  • message string - Reader-facing fallback message.
  • developmentDiagnostic Object|null - Development diagnostic payload when enabled.
JavaScript Event

razorwire:form:failure

Source

A RazorWire-enhanced form submission failed and custom UI may handle the failure.

razorwire:form:failure
  • Target: form[data-rw-form="true"]
  • Fires when: Turbo reports a failed form submission or RazorWire catches a network failure.
  • Bubbles: true
  • Cancelable: true

Detail fields

  • detail FormFailureDetail - Failure payload.

    Type preview: FormFailureDetail - Failure payload passed through event.detail for a failed RazorWire-enhanced form submission.

    • form HTMLFormElement - Submitted form.
    • submitter HTMLElement|null - Button or submit control that initiated the submission.
    • statusCode number|null - HTTP status code when available.
    • handled boolean - Whether the server response already handled the failure.
    • responseKind "turbo-stream"|"html"|"json"|"unknown"|"network" - Failure category.
    • View full FormFailureDetail contract
  • detail.form HTMLFormElement - Submitted form.
  • detail.submitter HTMLElement|null - Button or submit control that initiated the submission.
  • detail.statusCode number|null - HTTP status code when available.
  • detail.handled boolean - Whether the server response already handled the failure.
  • detail.responseKind "turbo-stream"|"html"|"json"|"unknown"|"network" - Failure category.
  • detail.target Element - Stream target or form that should own the failure UI.
  • detail.message string - Reader-facing fallback message.
  • detail.developmentDiagnostic Object|null - Development diagnostic payload when enabled.
JavaScript Event

razorwire:form:diagnostic

Source

Development diagnostics are available for a failed RazorWire-enhanced form submission.

razorwire:form:diagnostic
  • Target: form[data-rw-form="true"]
  • Fires when: development diagnostics are enabled for a failed RazorWire-enhanced form.
  • Bubbles: true
  • Cancelable: false

Detail fields

  • detail.form HTMLFormElement - Submitted form.
  • detail.statusCode number|null - HTTP status code when available.
  • detail.title string - Short diagnostic title.
  • detail.detail string - Diagnostic explanation.
  • detail.docsHref string - Documentation link target.
  • detail.hints string[] - Suggested fixes.
JavaScript Event

razorwire:form:submit-end

Source

A RazorWire-enhanced form finished submitting.

razorwire:form:submit-end
  • Target: form[data-rw-form="true"]
  • Fires when: Turbo finishes a RazorWire-enhanced form submission or RazorWire handles a fetch error.
  • Bubbles: true
  • Cancelable: false

Detail fields

  • detail.form HTMLFormElement - Submitted form.
  • detail.submitter HTMLElement|null - Button or submit control that initiated the submission.
  • detail.success boolean - Whether the submission succeeded.
  • detail.statusCode number|null - HTTP status code when available.
  • detail.handled boolean - Whether the server response already handled the result.
JavaScript Event

razorwire:stream:error

Source

A RazorWire stream source reported a native EventSource error.

razorwire:stream:error
  • Target: rw-stream-source
  • Fires when: The browser reports an EventSource error for a registered RazorWire stream source. Native EventSource does not expose HTTP status codes or response bodies to application JavaScript, so use server logs and the Network tab for exact rejection reasons.
  • Bubbles: true
  • Cancelable: false

Detail fields

  • detail.channel string|null - Client-derived channel token for the stream source.
  • detail.source Element - Stream source element that observed the error.
  • detail.state "connecting"|"connected"|"disconnected"|string - Last RazorWire stream state before the error callback.
  • detail.readyState number - Native EventSource readyState value.
  • detail.src string - Stream source URL.
JavaScript Attribute

data-rw-form

Source

Enables RazorWire form failure handling on a form.

data-rw-form
  • Target: form
  • Type: {"true"}
JavaScript Attribute

data-rw-page-nav

Source

Marks a same-page navigation root that RazorWire should enhance.

data-rw-page-nav
  • Target: nav, aside, div
  • Type: {"true"}
JavaScript Attribute

data-rw-section-copy-root

Source

Marks an optional root that scopes section-copy status, generated buttons, feedback timers, and cleanup.

data-rw-section-copy-root
  • Target: section, article, main, div
  • Type: {"true"}
JavaScript Attribute

data-rw-section-copy

Source

Marks a button that copies a section permalink for the referenced target id.

data-rw-section-copy
  • Target: button
  • Type: {string}
JavaScript Attribute

data-rw-section-copy-title

Source

Provides reader-facing section title copy for `aria-label`, live status, and fallback dialog labels.

data-rw-section-copy-title
  • Target: button[data-rw-section-copy], [data-rw-section-copy-target]
  • Type: {string}
JavaScript Attribute

data-rw-section-copy-status

Source

Marks an optional live status region for section-copy feedback.

data-rw-section-copy-status
  • Target: span, div
  • Type: {"true"}
JavaScript Attribute

data-rw-section-copy-target

Source

Marks a heading or section container that should receive a generated plain-text copy button.

data-rw-section-copy-target
  • Target: h1, h2, h3, h4, h5, h6, header, section, div
  • Type: {"true"}
JavaScript Attribute

data-rw-page-nav-toggle

Source

Marks a button that toggles the optional page navigation panel.

data-rw-page-nav-toggle
  • Target: button
  • Type: {"true"}
JavaScript Attribute

data-rw-page-nav-panel

Source

Marks the optional panel that should close after successful same-page navigation.

data-rw-page-nav-panel
  • Target: div, nav, ul
  • Type: {"true"}
JavaScript CSS Hook

[data-rw-page-nav-enhanced="true"]

Source

Stable selector for page navigation roots that have been enhanced by RazorWire.

[data-rw-page-nav-enhanced="true"]
  • Target: [data-rw-page-nav]
  • Hook kind: data-attribute
  • Stability: stable
JavaScript CSS Hook

[data-rw-page-nav-active="true"]

Source

Stable selector for the active page navigation link.

[data-rw-page-nav-active="true"]
  • Target: a[data-rw-page-nav-link]
  • Hook kind: data-attribute
  • Stability: stable
JavaScript CSS Hook

scroll-padding-block

Source

Logical CSS inset contract for active page navigation reveal inside overflowing vertical nav surfaces.

scroll-padding-block
  • Target: visible vertical scrollable ancestor between `a[data-rw-page-nav-link]` and `[data-rw-page-nav]`
  • Hook kind: css-property
  • Stability: stable
JavaScript CSS Hook

scroll-padding-top

Source

Start-side CSS inset contract for active page navigation reveal inside overflowing vertical nav surfaces.

scroll-padding-top
  • Target: visible vertical scrollable ancestor between `a[data-rw-page-nav-link]` and `[data-rw-page-nav]`
  • Hook kind: css-property
  • Stability: stable
JavaScript CSS Hook

scroll-padding-bottom

Source

End-side CSS inset contract for active page navigation reveal inside overflowing vertical nav surfaces.

scroll-padding-bottom
  • Target: visible vertical scrollable ancestor between `a[data-rw-page-nav-link]` and `[data-rw-page-nav]`
  • Hook kind: css-property
  • Stability: stable
JavaScript CSS Hook

[data-rw-page-nav-panel-state="closed"]

Source

Stable selector for page navigation panels that RazorWire closed.

[data-rw-page-nav-panel-state="closed"]
  • Target: [data-rw-page-nav-panel]
  • Hook kind: data-attribute
  • Stability: stable
JavaScript CSS Hook

[data-rw-section-copy-enhanced="true"]

Source

Stable selector for roots enhanced by the section-copy runtime.

[data-rw-section-copy-enhanced="true"]
  • Target: [data-rw-section-copy-root], body
  • Hook kind: data-attribute
  • Stability: stable
JavaScript CSS Hook

[data-rw-section-copy-inserted="true"]

Source

Stable selector for generated section-copy buttons.

[data-rw-section-copy-inserted="true"]
  • Target: button[data-rw-section-copy]
  • Hook kind: data-attribute
  • Stability: stable
JavaScript CSS Hook

[data-rw-section-copy-state="copied|fallback"]

Source

Stable selector for transient copy feedback state.

[data-rw-section-copy-state="copied|fallback"]
  • Target: button[data-rw-section-copy]
  • Hook kind: data-attribute
  • Stability: stable
JavaScript CSS Hook

[data-rw-section-copy-message]

Source

Stable selector for generated section-copy feedback text attached to a button.

[data-rw-section-copy-message]
  • Target: button[data-rw-section-copy]
  • Hook kind: data-attribute
  • Stability: stable
JavaScript CSS Hook

[data-rw-section-copy-fallback="true"]

Source

Stable selector for runtime-generated section-copy clipboard fallback UI.

[data-rw-section-copy-fallback="true"]
  • Target: generated fallback dialog
  • Hook kind: data-attribute
  • Stability: stable
JavaScript CSS Hook

[data-rw-section-copy-status-generated="true"]

Source

Stable selector for runtime-generated section-copy status regions.

[data-rw-section-copy-status-generated="true"]
  • Target: generated status region
  • Hook kind: data-attribute
  • Stability: stable
JavaScript Attribute

data-rw-form-failure

Source

Selects how RazorWire renders unhandled form failures.

data-rw-form-failure
  • Target: form[data-rw-form="true"]
  • Type: {"auto"|"manual"|"off"}
  • Default: auto
JavaScript CSS Hook

[data-rw-form-error-generated="true"]

Source

Stable selector for generated form failure UI.

[data-rw-form-error-generated="true"]
  • Target: generated form failure UI
  • Hook kind: data-attribute
  • Stability: stable
JavaScript CSS Custom Property

--rw-form-error-text

Source

Controls generated form failure text color.

--rw-form-error-text
  • Target: [data-rw-form-error-generated="true"]
  • Default: #3f3f46
  • Syntax: <color>
JavaScript Module Contract

mount

Source

Island modules may export mount to hydrate a server-rendered root.

mount(root, props)
  • Target: module referenced by data-rw-module
  • Signature: mount(root, props)

Parameters

  • root HTMLElement - Island root element.
  • props Record<string, unknown> - Parsed island props.
JavaScript Attribute

data-rw-module

Source

Names the browser module that should hydrate an island root.

data-rw-module
  • Target: [data-rw-module]
  • Type: {string}
JavaScript Config Field

window.RazorWire.formInteractionsManager

Source

Form interactions manager for conditional form targets and one-dimensional model-bound collection mechanics.

window.RazorWire.formInteractionsManager
  • Type: {object}
  • Source: <rw:scripts /> with rendered `[data-rw-form-toggle]` or `[data-rw-form-collection]` markup

Properties

  • scan Function - Re-scans the document for forms containing form-interaction markers after custom DOM updates.
  • prune Function - Removes controllers for disconnected forms.
  • getDiagnostics Function - Returns stable form-interaction diagnostic objects recorded since startup.
  • getDiagnostics[].message string - Required problem statement for invalid form-interaction markup.
  • getDiagnostics[].impact string - Required explanation of skipped behavior or submit-semantics risk.
  • getDiagnostics[].fix string - Required remediation guidance.
  • getDiagnostics[].docs string - Required repository documentation path for troubleshooting.
  • clearDiagnostics Function - Clears recorded diagnostics.
JavaScript Event

razorwire:form-toggle:before-change

Source

A conditional form toggle is about to reveal or hide its targets.

razorwire:form-toggle:before-change
  • Target: [data-rw-form-toggle]
  • Fires when: A form toggle value changes and RazorWire has resolved the same-form targets that may be shown or hidden.
  • Bubbles: true
  • Cancelable: true

Detail fields

  • detail.form HTMLFormElement - Owning form.
  • detail.control HTMLElement - Toggle control.
  • detail.target HTMLElement - First matched target.
  • detail.visible boolean - Whether targets will be shown.
JavaScript Event

razorwire:form-toggle:change

Source

A conditional form toggle finished revealing or hiding its targets.

razorwire:form-toggle:change
  • Target: [data-rw-form-toggle]
  • Fires when: RazorWire finishes applying visibility, state hooks, and optional disabled state for a conditional form target.
  • Bubbles: true
  • Cancelable: false

Detail fields

  • detail.form HTMLFormElement - Owning form.
  • detail.control HTMLElement - Toggle control.
  • detail.target HTMLElement - First matched target.
  • detail.visible boolean - Whether targets are shown.
JavaScript Event

razorwire:form-collection:before-add

Source

A model-bound collection command is about to add a row.

razorwire:form-collection:before-add
  • Target: [data-rw-form-collection-add]
  • Fires when: An add command has cloned the app-authored template and allocated a sparse collection index, before insertion.
  • Bubbles: true
  • Cancelable: true

Detail fields

  • detail.form HTMLFormElement - Owning form.
  • detail.root HTMLElement - Collection root.
  • detail.control HTMLElement - Command button.
  • detail.row HTMLElement - Row that will be inserted.
  • detail.index string - New sparse model-binding index.
  • detail.action "add" - Collection action.
JavaScript Event

razorwire:form-collection:add

Source

A model-bound collection command added a row.

razorwire:form-collection:add
  • Target: [data-rw-form-collection-add]
  • Fires when: RazorWire inserts a new collection row and enables its hidden `.index` marker.
  • Bubbles: true
  • Cancelable: false

Detail fields

  • detail.form HTMLFormElement - Owning form.
  • detail.root HTMLElement - Collection root.
  • detail.control HTMLElement - Command button.
  • detail.row HTMLElement - Inserted row.
  • detail.index string - New sparse model-binding index.
  • detail.action "add" - Collection action.
JavaScript Event

razorwire:form-collection:before-duplicate

Source

A model-bound collection command is about to duplicate a row.

razorwire:form-collection:before-duplicate
  • Target: [data-rw-form-collection-duplicate]
  • Fires when: A duplicate command has cloned the source row, rewritten index tokens, and prepared copyable user values before insertion.
  • Bubbles: true
  • Cancelable: true

Detail fields

  • detail.form HTMLFormElement - Owning form.
  • detail.root HTMLElement - Collection root.
  • detail.control HTMLElement - Command button.
  • detail.row HTMLElement - Cloned row that will be inserted.
  • detail.previousIndex string|null - Source row index.
  • detail.index string - New sparse model-binding index.
  • detail.action "duplicate" - Collection action.
JavaScript Event

razorwire:form-collection:duplicate

Source

A model-bound collection command duplicated a row.

razorwire:form-collection:duplicate
  • Target: [data-rw-form-collection-duplicate]
  • Fires when: RazorWire inserts a duplicated collection row with a new sparse model-binding index.
  • Bubbles: true
  • Cancelable: false

Detail fields

  • detail.form HTMLFormElement - Owning form.
  • detail.root HTMLElement - Collection root.
  • detail.control HTMLElement - Command button.
  • detail.row HTMLElement - Inserted clone.
  • detail.previousIndex string|null - Source row index.
  • detail.index string - New sparse model-binding index.
  • detail.action "duplicate" - Collection action.
JavaScript Event

razorwire:form-collection:before-remove

Source

A model-bound collection command is about to remove or mark a row.

razorwire:form-collection:before-remove
  • Target: [data-rw-form-collection-remove]
  • Fires when: A remove command resolves its physical-remove or mark-remove mode, before RazorWire mutates the row.
  • Bubbles: true
  • Cancelable: true

Detail fields

  • detail.form HTMLFormElement - Owning form.
  • detail.root HTMLElement - Collection root.
  • detail.control HTMLElement - Command button.
  • detail.row HTMLElement - Row that will be removed or marked.
  • detail.action "physical-remove"|"mark-remove" - Remove action.
  • detail.removeMode "physical"|"mark" - Remove mode.
  • detail.index string - Existing model-binding index.
JavaScript Event

razorwire:form-collection:remove

Source

A model-bound collection command removed or marked a row.

razorwire:form-collection:remove
  • Target: [data-rw-form-collection-remove]
  • Fires when: RazorWire finishes physically removing a row or marking it for app-owned deletion.
  • Bubbles: true
  • Cancelable: false

Detail fields

  • detail.form HTMLFormElement - Owning form.
  • detail.root HTMLElement - Collection root.
  • detail.control HTMLElement - Command button.
  • detail.row HTMLElement - Row that was removed or marked.
  • detail.action "physical-remove"|"mark-remove" - Remove action.
  • detail.removeMode "physical"|"mark" - Remove mode.
  • detail.index string - Existing model-binding index.
JavaScript Attribute

data-rw-form-toggle

Source

Marks a control that reveals or hides conditional form targets inside the same form.

data-rw-form-toggle
  • Target: input, select, textarea, button
  • Type: {string}
JavaScript Attribute

data-rw-form-toggle-target

Source

Marks an app-authored target revealed or hidden by a matching form toggle.

data-rw-form-toggle-target
  • Target: fieldset, section, div
  • Type: {string}
JavaScript Attribute

data-rw-form-collection

Source

Marks a one-dimensional ASP.NET Core model-bound collection root.

data-rw-form-collection
  • Target: div, section, fieldset
  • Type: {string}
JavaScript Attribute

data-rw-form-collection-row

Source

Marks an app-authored collection row.

data-rw-form-collection-row
  • Target: fieldset, div, tr
  • Type: {"true"}
JavaScript Attribute

data-rw-form-collection-template

Source

Marks the app-authored row template that contains the `__index__` token.

data-rw-form-collection-template
  • Target: template
  • Type: {"true"}
JavaScript Attribute

data-rw-form-collection-add

Source

Marks a button that adds a row from the collection template.

data-rw-form-collection-add
  • Target: button
  • Type: {"true"}
JavaScript Attribute

data-rw-form-collection-duplicate

Source

Marks a button that duplicates the nearest collection row.

data-rw-form-collection-duplicate
  • Target: button
  • Type: {"true"}
JavaScript Attribute

data-rw-form-collection-remove

Source

Marks a button that physically removes or marks the nearest collection row.

data-rw-form-collection-remove
  • Target: button
  • Type: {"physical"|"mark"|"true"}
JavaScript CSS Hook

[data-rw-form-interactions-enhanced="true"]

Source

Stable selector for forms enhanced by the form-interactions runtime.

[data-rw-form-interactions-enhanced="true"]
  • Target: form
  • Hook kind: data-attribute
  • Stability: stable
JavaScript Attribute

data-rw-strategy

Source

Selects when an island module hydrates.

data-rw-strategy
  • Target: [data-rw-module]
  • Type: {"load"|"idle"|"visible"|"only"}
  • Default: load
JavaScript Attribute

data-rw-props

Source

JSON props passed to an island module's mount function.

data-rw-props
  • Target: [data-rw-module]
  • Type: {string}