Documentation ¶
Index ¶
- type Builder
- func (b *Builder) AddedClass(value string) *Builder
- func (b *Builder) AllowEval(value bool) *Builder
- func (b *Builder) AllowScriptTags(value bool) *Builder
- func (b *Builder) AttributesToSettle(value []string) *Builder
- func (b *Builder) Build() map[string]any
- func (b *Builder) DefaultFocusScroll(value bool) *Builder
- func (b *Builder) DefaultSettleDelay(value time.Duration) *Builder
- func (b *Builder) DefaultSwapDelay(value time.Duration) *Builder
- func (b *Builder) DefaultSwapStyle(value swap.Strategy) *Builder
- func (b *Builder) DisableSelector(value string) *Builder
- func (b *Builder) GetCacheBusterParam(value bool) *Builder
- func (b *Builder) GlobalViewTransitions(value bool) *Builder
- func (b *Builder) HistoryCacheSize(value int) *Builder
- func (b *Builder) HistoryEnabled(value bool) *Builder
- func (b *Builder) IgnoreTitle(value bool) *Builder
- func (b *Builder) IncludeIndicatorStyles(value bool) *Builder
- func (b *Builder) IndicatorClass(value string) *Builder
- func (b *Builder) InlineScriptNonce(value string) *Builder
- func (b *Builder) MethodsThatUseUrlParams(value []HTTPMethod) *Builder
- func (b *Builder) RefreshOnHistoryMiss(value bool) *Builder
- func (b *Builder) RequestClass(value string) *Builder
- func (b *Builder) ScrollBehavior(value ScrollBehavior) *Builder
- func (b *Builder) ScrollIntoViewOnBoost(value bool) *Builder
- func (b *Builder) SelfRequestsOnly(value bool) *Builder
- func (b *Builder) SettlingClass(value string) *Builder
- func (b *Builder) SwappingClass(value string) *Builder
- func (b *Builder) Timeout(value time.Duration) *Builder
- func (b *Builder) TriggerSpecsCache(value string) *Builder
- func (b *Builder) UseTemplateFragments(value bool) *Builder
- func (b *Builder) WSBinaryType(value string) *Builder
- func (b *Builder) WSReconnectDelay(value string) *Builder
- func (b *Builder) WithCredentials(value bool) *Builder
- type HTTPMethod
- type ScrollBehavior
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
func (*Builder) AddedClass ¶
defaults to htmx-added
func (*Builder) AllowEval ¶
defaults to true, can be used to disable htmx’s use of eval for certain features (e.g. trigger filters)
func (*Builder) AllowScriptTags ¶
defaults to true, determines if htmx will process script tags found in new content
func (*Builder) AttributesToSettle ¶
defaults to ["class", "style", "width", "height"], the attributes to settle during the settling phase
func (*Builder) DefaultFocusScroll ¶
if the focused element should be scrolled into view, defaults to false and can be overridden using the focus-scroll swap modifier.
func (*Builder) DefaultSettleDelay ¶
defaults to 20
func (*Builder) DefaultSwapDelay ¶
defaults to 0
func (*Builder) DefaultSwapStyle ¶
defaults to innerHTML
func (*Builder) DisableSelector ¶
defaults to [hx-disable], [data-hx-disable], htmx will not process elements with this attribute on it or a parent
func (*Builder) GetCacheBusterParam ¶
defaults to false, if set to true htmx will include a cache-busting parameter in GET requests to avoid caching partial responses by the browser
func (*Builder) GlobalViewTransitions ¶
if set to true, htmx will use the View Transition API when swapping in new content.
func (*Builder) HistoryCacheSize ¶
defaults to 10
func (*Builder) HistoryEnabled ¶
HistoryEnabled defaults to true, really only useful for testing
func (*Builder) IgnoreTitle ¶
defaults to false, if set to true htmx will not update the title of the document when a title tag is found in new content
func (*Builder) IncludeIndicatorStyles ¶
defaults to true (determines if the indicator styles are loaded) )
func (*Builder) IndicatorClass ¶
defaults to htmx-indicator
func (*Builder) InlineScriptNonce ¶
defaults to ”, meaning that no nonce will be added to inline scripts
func (*Builder) MethodsThatUseUrlParams ¶
func (b *Builder) MethodsThatUseUrlParams(value []HTTPMethod) *Builder
defaults to ["get"], htmx will format requests with these methods by encoding their parameters in the URL, not the request body
func (*Builder) RefreshOnHistoryMiss ¶
defaults to false, if set to true htmx will issue a full page refresh on history misses rather than use an AJAX request
func (*Builder) RequestClass ¶
defaults to htmx-request
func (*Builder) ScrollBehavior ¶
func (b *Builder) ScrollBehavior(value ScrollBehavior) *Builder
defaults to ‘smooth’, the behavior for a boosted link on page transitions. The allowed values are auto and smooth. Smooth will smoothscroll to the top of the page while auto will behave like a vanilla link.
func (*Builder) ScrollIntoViewOnBoost ¶
defaults to true, whether or not the target of a boosted element is scrolled into the viewport. If hx-target is omitted on a boosted element, the target defaults to body, causing the page to scroll to the top.
func (*Builder) SelfRequestsOnly ¶
defaults to false, if set to true will only allow AJAX requests to the same domain as the current document
func (*Builder) SettlingClass ¶
defaults to htmx-settling
func (*Builder) SwappingClass ¶
defaults to htmx-swapping
func (*Builder) Timeout ¶
defaults to 0, the number of milliseconds a request can take before automatically being terminated
func (*Builder) TriggerSpecsCache ¶
defaults to null, the cache to store evaluated trigger specifications into, improving parsing performance at the cost of more memory usage. You may define a simple object to use a never-clearing cache, or implement your own system using a proxy object
func (*Builder) UseTemplateFragments ¶
defaults to false, HTML template tags for parsing content from the server (not IE11 compatible!)
func (*Builder) WSBinaryType ¶
defaults to blob, the the type of binary data being received over the WebSocket connection
func (*Builder) WSReconnectDelay ¶
defaults to ["get"], htmx will format requests with these methods by encoding their parameters in the URL, not the request body
func (*Builder) WithCredentials ¶
defaults to false, allow cross-site Access-Control requests using credentials such as cookies, authorization headers or TLS client certificates
type HTTPMethod ¶
type HTTPMethod string
An HTTPMethod is a named HTTP Method used for [Config.MethodsThatUseUrlParams]
const ( MethodGet HTTPMethod = "get" MethodPost HTTPMethod = "post" MethodPut HTTPMethod = "put" MethodDelete HTTPMethod = "delete" MethodPatch HTTPMethod = "patch" MethodHead HTTPMethod = "head" MethodOptions HTTPMethod = "options" )
type ScrollBehavior ¶
type ScrollBehavior string
const ( ScrollBehaviorAuto ScrollBehavior = "auto" // auto will behave like a vanilla link. ScrollBehaviorSmooth ScrollBehavior = "smooth" // smooth (default) will smoothscroll to the top of the page )