ViewContext ViewContext { get; set; }
Gets or sets the view context.
Tag helper for rendering the necessary RazorWire scripts.
void Process(TagHelperContext context, TagHelperOutput output)
Renders the client-side script tags required by RazorWire and removes the wrapper element so no enclosing tag is emitted.
contextThe current tag helper context.outputThe tag helper output that will be modified to contain the script elements and have no wrapper tag.ViewContext ViewContext { get; set; }
Gets or sets the view context.
A TagHelper that automatically applies version hashing to script and link tags that reference local files, if the asp-append-version attribute is missing.
bool IsLocal(string? path)
Determines if the provided path is a local path suitable for versioning.
pathThe path to check.true if the path is local (starts with '/' or '~') and is not protocol-relative; otherwise, false.
Relative paths (e.g. "css/site.css") are excluded because they are ambiguous without knowing the current request path context, which complicates server-side resolution. Use root-relative ('/') or app-relative ('~') paths for automatic versioning.
ViewContext ViewContext { get; set; }
Gets or sets the view context.
This property is automatically set by the framework when the TagHelper is created.
A TagHelper that marks an element as requiring a specific Turbo Stream to be established before becoming active.
void Process(TagHelperContext context, TagHelperOutput output)
Applies stream-requirement attributes and disables the element when a requires-stream value is present.
RequiresStream is null or whitespace, the output is left unchanged. Otherwise adds the following attributes to the element: data-rw-requires-stream set to the RequiresStream valuearia-disabled to "true"disabled to "disabled" (only for supported form elements)string? RequiresStream { get; set; }
Gets or sets the name or identifier of the stream required by this element.
A Tag Helper that enhances a standard <form> element with RazorWire/Turbo features.
void Process(TagHelperContext context, TagHelperOutput output)
Processes a form tag by removing attributes that start with "rw-" and configuring Turbo attributes based on the tag helper's properties.
contextThe context for the current tag helper execution.outputThe tag helper output whose attributes will be modified.bool Enabled { get; set; }
Gets or sets a value indicating whether RazorWire/Turbo enhancement is enabled for this form. Defaults to true.
string? TargetFrame { get; set; }
Gets or sets the identifier of the Turbo Frame that this form should target.
A TagHelper that renders a Turbo Frame as a "RazorWire Island", enabling partial page updates and client-side module mounting.
void Process(TagHelperContext context, TagHelperOutput output)
Renders a <turbo-frame> element whose attributes are populated from the tag helper's properties.
ArgumentExceptionThrown when Id is null, empty, or consists only of white-space characters.Validates that Id is not null, empty, or whitespace and sets attributes such as id, src, loading, data-turbo-permanent, data-rw-swr, style (view-transition-name), data-rw-export, and client-related data attributes when the corresponding properties are provided.
string Id { get; set; }
The unique identifier for the island, which becomes the id of the rendered turbo-frame.
string? Src { get; set; }
The source URL for the turbo-frame content.
string? Loading { get; set; }
The loading strategy for the turbo-frame (e.g., "eager", "lazy").
bool Permanent { get; set; }
If true, the rendered element will have the 'data-turbo-permanent' attribute.
bool Swr { get; set; }
If true, enables Stale-While-Revalidate behavior via 'data-rw-swr'.
string? TransitionName { get; set; }
The name for the CSS View Transition, applied as 'view-transition-name' in the style attribute.
string? Export { get; set; }
The name of the client-side module to export/expose.
string? ClientModule { get; set; }
The path to the client-side module to mount on this island.
string? ClientStrategy { get; set; }
The mounting strategy for the client module (e.g., "load", "visible", "idle").
string? ClientProps { get; set; }
Initial properties (JSON) to pass to the client module's mount function.
Tag helper that renders an rw-stream-source element to establish a connection to a RazorWire stream.
void Process(TagHelperContext context, TagHelperOutput output)
Configures the rw-stream-source element by setting its src attribute and handling the permanent option.
contextContains information associated with the current HTML tag.outputA stateful HTML element used to generate an HTML tag.InvalidOperationExceptionThrown when Channel is null, empty, or contains only whitespace.string Channel { get; set; }
Gets or sets the channel name of the stream to connect to. This attribute is required.
bool Permanent { get; set; }
Gets or sets a value indicating whether the stream source should be preserved across Turbo page loads.
Tag helper that renders a <time> element with a UTC timestamp for client-side time formatting.
When rw-type="local", the JavaScript runtime formats the timestamp to the user's local timezone. When rw-type="utc", the timestamp is formatted in UTC.
<time rw-type="local" datetime="@Model.Timestamp"></time>
<time rw-type="local" datetime="@Model.Timestamp" rw-display="relative"></time>
<time rw-type="local" datetime="@Model.Timestamp" rw-display="datetime" rw-format="short"></time>
<time rw-type="utc" datetime="@Model.Timestamp"></time>void Process(TagHelperContext context, TagHelperOutput output)
Renders a <time> element with the UTC timestamp in the datetime attribute and data attributes for client-side JavaScript formatting.
contextContains information associated with the current HTML tag.outputA stateful HTML element used to generate an HTML tag.ArgumentExceptionThrown when Value is the default value or if Display or Format have invalid values.string? RwType { get; set; }
Gets or sets the timezone type for RazorWire time formatting. Valid values: local (user's browser timezone) or utc (UTC timezone).
DateTimeOffset Value { get; set; }
The UTC timestamp to display, sourced from the datetime attribute.
string Display { get; set; }
Gets or sets the display mode for the formatted time. Valid values: time (default), date, datetime, or relative.
string? Format { get; set; }
Gets or sets the format style for absolute time formatting. Valid values: short, medium (default), long, or full.