Table of Contents

Class HtmxV1Config

Namespace
Ramstack.HtmxToolkit.Configuration
Assembly
Ramstack.HtmxToolkit.dll

Represents the configuration for HTMX 1.x.

public sealed class HtmxV1Config : HtmxConfig
Inheritance
HtmxV1Config
Inherited Members

Constructors

HtmxV1Config()

Represents the configuration for HTMX 1.x.

public HtmxV1Config()

Properties

AddedClass

Gets or sets the added class. The HTMX default is htmx-added.

public string? AddedClass { get; set; }

Property Value

string

AllowEval

Gets or sets a value indicating whether the use of eval is allowed. The HTMX default is true.

public bool? AllowEval { get; set; }

Property Value

bool?

AllowScriptTags

Gets or sets a value indicating whether <script> tags should be processed in new content. The HTMX default is true.

public bool? AllowScriptTags { get; set; }

Property Value

bool?

AttributesToSettle

Gets or sets the attributes to settle during the settling phase. The HTMX default is ["class", "style", "width", "height"].

public string[]? AttributesToSettle { get; set; }

Property Value

string[]

DefaultFocusScroll

Gets or sets a value indicating whether the focused element should be scrolled into view. The HTMX default is false.

public bool? DefaultFocusScroll { get; set; }

Property Value

bool?

DefaultSettleDelay

Gets or sets the default settle delay in milliseconds. The HTMX default is 20.

public int? DefaultSettleDelay { get; set; }

Property Value

int?

DefaultSwapDelay

Gets or sets the default swap delay in milliseconds. The HTMX default is 0.

public int? DefaultSwapDelay { get; set; }

Property Value

int?

DefaultSwapStyle

Gets or sets the default swap style. The HTMX default is InnerHtml.

[JsonConverter(typeof(HtmxSwapJsonConverter))]
public HtmxSwap? DefaultSwapStyle { get; set; }

Property Value

HtmxSwap?

DisableSelector

Gets or sets the selector for elements that HTMX must not process. The HTMX default is [hx-disable], [data-hx-disable].

public string? DisableSelector { get; set; }

Property Value

string

GetCacheBusterParam

Gets or sets a value indicating whether GET requests use a cache-busting parameter. The HTMX default is false.

public bool? GetCacheBusterParam { get; set; }

Property Value

bool?

GlobalViewTransitions

Gets or sets a value indicating whether the View Transition API should be used for swaps. The HTMX default is false.

public bool? GlobalViewTransitions { get; set; }

Property Value

bool?

HistoryCacheSize

Gets or sets the size of the history cache. The HTMX default is 10.

public int? HistoryCacheSize { get; set; }

Property Value

int?

HistoryEnabled

Gets or sets a value indicating whether HTMX history support is enabled. The HTMX default is true.

public bool? HistoryEnabled { get; set; }

Property Value

bool?

IgnoreTitle

Gets or sets a value indicating whether document titles found in new content are ignored. The HTMX default is false.

public bool? IgnoreTitle { get; set; }

Property Value

bool?

IncludeIndicatorStyles

Gets or sets a value indicating whether the indicator styles are loaded. The HTMX default is true.

public bool? IncludeIndicatorStyles { get; set; }

Property Value

bool?

IndicatorClass

Gets or sets the indicator class. The HTMX default is htmx-indicator.

public string? IndicatorClass { get; set; }

Property Value

string

InlineScriptNonce

Gets or sets the nonce added to inline scripts. The HTMX default is an empty string.

public string? InlineScriptNonce { get; set; }

Property Value

string

MethodsThatUseUrlParams

Gets or sets the HTTP methods that use URL parameters. The HTMX default is ["get"].

[JsonConverter(typeof(HttpVerbArrayJsonConverter))]
public HttpVerb[]? MethodsThatUseUrlParams { get; set; }

Property Value

HttpVerb[]

RefreshOnHistoryMiss

Gets or sets a value indicating whether a full-page refresh should be issued on history misses rather than using an AJAX request. The HTMX default is false.

public bool? RefreshOnHistoryMiss { get; set; }

Property Value

bool?

RequestClass

Gets or sets the request class. The HTMX default is htmx-request.

public string? RequestClass { get; set; }

Property Value

string

ScrollBehavior

Gets or sets the scrolling behavior used by the show modifier of hx-swap. The HTMX default is Smooth.

[JsonConverter(typeof(HtmxScrollBehaviorJsonConverter))]
public HtmxScrollBehavior? ScrollBehavior { get; set; }

Property Value

HtmxScrollBehavior?

ScrollIntoViewOnBoost

Gets or sets a value indicating whether boosted targets are scrolled into the viewport. The HTMX default is true.

public bool? ScrollIntoViewOnBoost { get; set; }

Property Value

bool?

SelfRequestsOnly

Gets or sets a value indicating whether requests are restricted to the current origin. The HTMX default is false.

public bool? SelfRequestsOnly { get; set; }

Property Value

bool?

SettlingClass

Gets or sets the settling class. The HTMX default is htmx-settling.

public string? SettlingClass { get; set; }

Property Value

string

SwappingClass

Gets or sets the swapping class. The HTMX default is htmx-swapping.

public string? SwappingClass { get; set; }

Property Value

string

Timeout

Gets or sets the request timeout, in milliseconds. The HTMX default is 0.

public int? Timeout { get; set; }

Property Value

int?

TriggerSpecsCacheEnabled

Gets or sets a value indicating whether parsed trigger specifications use a never-clearing cache. The cache is disabled by default.

[JsonPropertyName("triggerSpecsCache")]
[JsonConverter(typeof(HtmxTriggerSpecsCacheJsonConverter))]
public bool? TriggerSpecsCacheEnabled { get; set; }

Property Value

bool?

UseTemplateFragments

Gets or sets a value indicating whether HTML <template> tags are used to parse content. The HTMX default is false.

public bool? UseTemplateFragments { get; set; }

Property Value

bool?

WithCredentials

Gets or sets a value indicating whether credentials are included in cross-origin requests. The HTMX default is false.

public bool? WithCredentials { get; set; }

Property Value

bool?

WsBinaryType

Gets or sets the type of binary data received over WebSocket connections. The HTMX default is Blob.

[JsonConverter(typeof(HtmxBinaryTypeJsonConverter))]
public HtmxBinaryType? WsBinaryType { get; set; }

Property Value

HtmxBinaryType?

Methods

Serialize()

Serializes this configuration to a JSON string.

protected override string Serialize()

Returns

string

A JSON string representing this configuration.